From aa59a409b36c7ef7018d1785d2dba4da17b57864 Mon Sep 17 00:00:00 2001 From: Caleb Lam <67606076+ClamEater14@users.noreply.github.com> Date: Mon, 6 Jun 2022 04:07:37 -0400 Subject: [PATCH] feat(CommandInteraction): add 'commandGuildId' (#8018) --- packages/discord.js/src/structures/CommandInteraction.js | 6 ++++++ packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 7 insertions(+) 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;