mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +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
|
* 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user