import type { AdaptorPartialMember } from "./guild"; import type { AdaptorAttachment } from "./index"; import type { AdaptorPermissions } from "./index"; import type { AdaptorPartialChannel, Snowflake } from "./index"; import type { AdaptorRole } from "./permissions"; import type { AdaptorUser } from "./user"; /** * @see https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */ export type AdaptorInteraction = AdaptorPingInteraction | AdaptorApplicationCommandInteraction | AdaptorMessageComponentInteraction | AdaptorApplicationCommandAutoCompleteInteraction | AdaptorModalSubmitInteraction; export type AdaptorMessageComponentInteraction = AdaptorButtonInteraction | AdaptorStringSelectInteraction | AdaptorUserSelectInteraction | AdaptorRoleSelectInteraction | AdaptorMentionableSelectInteraction | AdaptorChannelSelectInteraction; export interface AdaptorInteractionBase { /** * ID of the interaction */ id: Snowflake; /** * ID of the application this interaction is for */ applicationId: Snowflake; /** * Continuation token for responding to the interaction */ token: string; /** * Read-only property, always 1 */ version: 1; } export interface AdaptorUserInvokedInteractionBase extends AdaptorInteractionBase { /** * Guild that the interaction was sent from */ guildId: T extends "guild" ? Snowflake : null; /** * Channel that the interaction was sent from */ channelId: Snowflake; /** * Guild member data for the invoking user, including permissions */ member: T extends "guild" ? AdaptorPartialMember : null; /** * User object for the invoking user */ user: AdaptorUser; /** * Bitwise set of permissions the app or bot has within the channel the interaction was sent from */ appPermissions: T extends "guild" ? AdaptorPermissions : null; /** * Selected language of the invoking user * @see https://discord.com/developers/docs/reference#locales */ locale: string; /** * Guild's preferred locale, if invoked in a guild * @see https://discord.com/developers/docs/reference#locales */ guildLocale: T extends "guild" ? string : null; } export interface AdaptorPingInteraction extends AdaptorInteractionBase { type: "ping"; } export interface AdaptorApplicationCommandInteraction extends AdaptorUserInvokedInteractionBase { type: "applicationCommand"; data: { id: Snowflake; name: string; type: "chatInput" | "user" | "message"; resolved: { users: Record; members: Record; roles: Record; channels: Record; attachments: Record; }; options: AdaptorApplicationCommandInteractionOption[]; guildId: Snowflake | null; targetId: Snowflake | null; }; } export type AdaptorApplicationCommandInteractionOption = AdaptorApplicationCommandInteractionOptionSubCommand | AdaptorApplicationCommandInteractionOptionSubCommandGroup | AdaptorApplicationCommandInteractionOptionString | AdaptorApplicationCommandInteractionOptionBoolean | AdaptorApplicationCommandInteractionOptionNumber | AdaptorApplicationCommandInteractionOptionSnowflake; export interface AdaptorApplicationCommandInteractionOptionNumber { type: "integer" | "number"; value: number; } export interface AdaptorApplicationCommandInteractionOptionString { type: "string"; value: string; } export interface AdaptorApplicationCommandInteractionOptionBoolean { type: "boolean"; value: boolean; } export interface AdaptorApplicationCommandInteractionOptionSnowflake { type: "user" | "channel" | "role" | "mentionable" | "attachment"; value: Snowflake; } export interface AdaptorApplicationCommandInteractionOptionSubCommand { type: "subCommand"; name: string; options: Exclude[]; } export interface AdaptorApplicationCommandInteractionOptionSubCommandGroup { type: "subCommandGroup"; name: string; options: AdaptorApplicationCommandInteractionOptionSubCommand[]; } export interface AdaptorButtonInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "button"; }; } export interface AdaptorStringSelectInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "stringSelect"; values: string[]; }; } export interface AdaptorUserSelectInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "userSelect"; values: Snowflake[]; resolved: { users: Record; members: Record; }; }; } export interface AdaptorRoleSelectInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "roleSelect"; values: Snowflake[]; resolved: { roles: Record; }; }; } export interface AdaptorMentionableSelectInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "mentionableSelect"; values: Snowflake[]; resolved: { users: Record; members: Record; roles: Record; }; }; } export interface AdaptorChannelSelectInteraction extends AdaptorUserInvokedInteractionBase { type: "messageComponent"; data: { customId: string; componentType: "channelSelect"; values: Snowflake[]; resolved: { channels: Record; }; }; } export interface AdaptorModalSubmitInteraction extends AdaptorUserInvokedInteractionBase { type: "modalSubmit"; data: { customId: string; fields: Record; }; } export declare const isAdaptorPingInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorPingInteraction; export declare const isAdaptorApplicationCommandInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorApplicationCommandInteraction; export declare const isAdaptorButtonInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorButtonInteraction; export declare const isAdaptorStringSelectInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorStringSelectInteraction; export declare const isAdaptorUserSelectInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorUserSelectInteraction; export declare const isAdaptorRoleSelectInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorRoleSelectInteraction; export declare const isAdaptorMentionableSelectInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorMentionableSelectInteraction; export declare const isAdaptorChannelSelectInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorChannelSelectInteraction; export interface AdaptorApplicationCommandAutoCompleteInteraction extends AdaptorUserInvokedInteractionBase { type: "applicationCommandAutoComplete"; /** * discord-inquire will not use this */ data: unknown; } export declare const isAdaptorApplicationCommandAutoCompleteInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorApplicationCommandAutoCompleteInteraction; export declare const isAdaptorModalSubmitInteraction: (interaction: AdaptorInteraction) => interaction is AdaptorModalSubmitInteraction; //# sourceMappingURL=interaction.d.ts.map