Made Message.guild a getter

This commit is contained in:
Schuyler Cebulskie
2016-09-19 00:47:42 -04:00
parent 8603759b5e
commit d8542b3365
2 changed files with 9 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -21,12 +21,6 @@ class Message {
*/
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);
}
@@ -206,6 +200,14 @@ class Message {
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.
* @type {string}