fix(Message): handle fetched messages (#6325)

This commit is contained in:
Souji
2021-08-07 11:35:30 +02:00
committed by GitHub
parent 60ace9a2d4
commit ceae5960ed

View File

@@ -41,7 +41,7 @@ class Message extends Base {
* The id of the guild the message was sent in, if any * The id of the guild the message was sent in, if any
* @type {?Snowflake} * @type {?Snowflake}
*/ */
this.guildId = data.guild_id ?? null; this.guildId = data.guild_id ?? this.channel?.guild?.id ?? null;
/** /**
* Whether this message has been deleted * Whether this message has been deleted
@@ -390,7 +390,7 @@ class Message extends Base {
* @readonly * @readonly
*/ */
get guild() { get guild() {
return this.client.guilds.resolve(this.guildId); return this.client.guilds.resolve(this.guildId) ?? this.channel?.guild ?? null;
} }
/** /**