mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Made Message.guild a getter
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -21,12 +21,6 @@ class Message {
|
|||||||
*/
|
*/
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
|
|
||||||
/**
|
|
||||||
* If the message was sent in a guild, this will be the guild the message was sent in
|
|
||||||
* @type {?Guild}
|
|
||||||
*/
|
|
||||||
this.guild = channel.guild || null;
|
|
||||||
|
|
||||||
if (data) this.setup(data);
|
if (data) this.setup(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,6 +200,14 @@ class Message {
|
|||||||
return new Date(this._editedTimestamp);
|
return new Date(this._editedTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The guild the message was sent in (if in a guild channel)
|
||||||
|
* @type {?Guild}
|
||||||
|
*/
|
||||||
|
get guild() {
|
||||||
|
return this.channel.guild || null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The message contents with all mentions replaced by the equivalent text.
|
* The message contents with all mentions replaced by the equivalent text.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
|||||||
Reference in New Issue
Block a user