diff --git a/transformers/interaction.ts b/transformers/interaction.ts index b8056cf14..eb8f8292f 100644 --- a/transformers/interaction.ts +++ b/transformers/interaction.ts @@ -47,6 +47,7 @@ export function transformInteraction(bot: Bot, payload: DiscordInteraction) { : undefined, options: payload.data.options?.map((opt) => bot.transformers.interactionDataOptions(bot, opt)), targetId: payload.data.target_id ? bot.transformers.snowflake(payload.data.target_id) : undefined, + guildId: payload.data.guild_id ? bot.transformers.snowflake(payload.data.guild_id) : undefined, } : undefined, }; diff --git a/types/discord.ts b/types/discord.ts index 89a27375c..6ce3413f6 100644 --- a/types/discord.ts +++ b/types/discord.ts @@ -1275,6 +1275,7 @@ export interface DiscordInteraction { version: 1; /** For the message the button was attached to */ message?: DiscordMessage; + /** the command data payload */ data?: DiscordInteractionData; /** The selected language of the invoking user */ locale?: string; @@ -1301,6 +1302,8 @@ export interface DiscordInteractionData { id: string; /** The name of the invoked command */ name: string; + /** the type of the invoked command */ + type: ApplicationCommandTypes; /** Converted users + roles + channels + attachments */ resolved?: { /** The Ids and Message objects */ @@ -1320,6 +1323,8 @@ export interface DiscordInteractionData { options?: DiscordInteractionDataOption[]; /** The target id if this is a context menu command. */ target_id?: string; + /** the id of the guild the command is registered to */ + guild_id?: string; } export type DiscordInteractionDataOption = {