mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
fix(Message): handle fetched messages (#6325)
This commit is contained in:
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user