From 10a6c4287dd45a30290814e50fa29a086f85da02 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Mon, 13 Jun 2022 17:14:01 +0100 Subject: [PATCH] feat(AutocompleteInteraction): Add `commandGuildId` (#8086) --- .../discord.js/src/structures/AutocompleteInteraction.js | 6 ++++++ packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/packages/discord.js/src/structures/AutocompleteInteraction.js b/packages/discord.js/src/structures/AutocompleteInteraction.js index 94bb1353f..cc58e45d0 100644 --- a/packages/discord.js/src/structures/AutocompleteInteraction.js +++ b/packages/discord.js/src/structures/AutocompleteInteraction.js @@ -36,6 +36,12 @@ class AutocompleteInteraction 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 this interaction has already received a response * @type {boolean} diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 801147459..511bf0dd9 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -937,6 +937,7 @@ export class AutocompleteInteraction exten public commandId: Snowflake; public commandName: string; public commandType: ApplicationCommandType.ChatInput; + public commandGuildId: Snowflake | null; public responded: boolean; public options: Omit< CommandInteractionOptionResolver,