mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Add message.member if available
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -46,6 +46,14 @@ class Message {
|
|||||||
* The content of the message
|
* The content of the message
|
||||||
* @type {String}
|
* @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;
|
this.content = data.content;
|
||||||
/**
|
/**
|
||||||
* When the message was sent
|
* When the message was sent
|
||||||
@@ -137,6 +145,9 @@ class Message {
|
|||||||
patch(data) {
|
patch(data) {
|
||||||
if (data.author) {
|
if (data.author) {
|
||||||
this.author = this.client.users.get(data.author.id);
|
this.author = this.client.users.get(data.author.id);
|
||||||
|
if (this.guild) {
|
||||||
|
this.member = this.guild.member(this.author);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (data.content) {
|
if (data.content) {
|
||||||
this.content = data.content;
|
this.content = data.content;
|
||||||
|
|||||||
Reference in New Issue
Block a user