mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
make Message#member a getter
This commit is contained in:
@@ -54,13 +54,6 @@ class Message extends Base {
|
|||||||
*/
|
*/
|
||||||
this.author = this.client.users.add(data.author, !data.webhook_id);
|
this.author = this.client.users.add(data.author, !data.webhook_id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 ? this.guild.member(this.author) || null : null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not this message is pinned
|
* Whether or not this message is pinned
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@@ -201,6 +194,15 @@ class Message extends Base {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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}
|
||||||
|
*/
|
||||||
|
get member() {
|
||||||
|
return this.guild ? this.guild.member(this.author) || null : null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time the message was sent at
|
* The time the message was sent at
|
||||||
* @type {Date}
|
* @type {Date}
|
||||||
|
|||||||
Reference in New Issue
Block a user