mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
update DiscordInteractionData interface (#2208)
* update DiscordInteractionData interface add guildId add type also update interaction transformers * revert re-order changes Co-authored-by: ITOH <to@itoh.at>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user