diff --git a/packages/discord.js/src/structures/CommandInteraction.js b/packages/discord.js/src/structures/CommandInteraction.js index cfce2c8bc..042533a37 100644 --- a/packages/discord.js/src/structures/CommandInteraction.js +++ b/packages/discord.js/src/structures/CommandInteraction.js @@ -40,6 +40,12 @@ class CommandInteraction extends Interaction { */ this.commandType = data.data.type; + /** + * The id of the guild the invoked application command is registered to + * @type {?Snowflake} + */ + this.commandGuildId = data.data.guild_id ?? null; + /** * Whether the reply to this interaction has been deferred * @type {boolean} diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 835b3e087..e53991b34 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -432,6 +432,7 @@ export abstract class CommandInteraction e public commandId: Snowflake; public commandName: string; public commandType: ApplicationCommandType; + public commandGuildId: Snowflake | null; public deferred: boolean; public ephemeral: boolean | null; public replied: boolean;