Skip to content

Commit

Permalink
fix(Message): handle fetched messages (#6325)
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed Aug 7, 2021
1 parent 60ace9a commit ceae596
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structures/Message.js
Expand Up @@ -41,7 +41,7 @@ class Message extends Base {
* The id of the guild the message was sent in, if any
* @type {?Snowflake}
*/
this.guildId = data.guild_id ?? null;
this.guildId = data.guild_id ?? this.channel?.guild?.id ?? null;

/**
* Whether this message has been deleted
Expand Down Expand Up @@ -390,7 +390,7 @@ class Message extends Base {
* @readonly
*/
get guild() {
return this.client.guilds.resolve(this.guildId);
return this.client.guilds.resolve(this.guildId) ?? this.channel?.guild ?? null;
}

/**
Expand Down

0 comments on commit ceae596

Please sign in to comment.