mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Add message.member if available
This commit is contained in:
@@ -46,6 +46,14 @@ class Message {
|
||||
* The content of the message
|
||||
* @type {String}
|
||||
*/
|
||||
if (this.guild) {
|
||||
/**
|
||||
* Represents the Author of the message as a Guild Member. Only available if the message comes from a Guild
|
||||
* where the author is still a member.
|
||||
* @type {GuildMember}
|
||||
*/
|
||||
this.member = this.guild.member(this.author);
|
||||
}
|
||||
this.content = data.content;
|
||||
/**
|
||||
* When the message was sent
|
||||
@@ -137,6 +145,9 @@ class Message {
|
||||
patch(data) {
|
||||
if (data.author) {
|
||||
this.author = this.client.users.get(data.author.id);
|
||||
if (this.guild) {
|
||||
this.member = this.guild.member(this.author);
|
||||
}
|
||||
}
|
||||
if (data.content) {
|
||||
this.content = data.content;
|
||||
|
||||
Reference in New Issue
Block a user