mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
Made Message.guild a getter
This commit is contained in:
parent
8603759b5e
commit
d8542b3365
2 changed files with 9 additions and 7 deletions
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}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue