import type { RawFile } from '../api'; import { Attachment } from '../builders'; import type { ReturnCache } from '../cache'; import { type EntitlementStructure, type GuildRoleStructure, type GuildStructure, type InteractionGuildMemberStructure, type MessageStructure, type OptionResolverStructure, type UserStructure, type WebhookMessageStructure } from '../client/transformers'; import type { UsingClient } from '../commands'; import { type ComponentInteractionMessageUpdate, type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MessageCreateBodyRequest, type MessageUpdateBodyRequest, type MessageWebhookCreateBodyRequest, type ModalCreateBodyRequest, type ModalCreateOptions, type ObjectToLower, type OmitInsert, type ToClass, type When } from '../common'; import { type APIApplicationCommandAutocompleteInteraction, type APIApplicationCommandInteraction, type APIBaseInteraction, type APIChatInputApplicationCommandInteraction, type APIChatInputApplicationCommandInteractionData, type APICommandAutocompleteInteractionResponseCallbackData, type APIEntryPointCommandInteraction, type APIInteraction, type APIInteractionResponse, type APIInteractionResponseChannelMessageWithSource, type APIInteractionResponseDeferredChannelMessageWithSource, type APIInteractionResponseDeferredMessageUpdate, type APIInteractionResponsePong, type APIInteractionResponseUpdateMessage, type APIMessageApplicationCommandInteraction, type APIMessageApplicationCommandInteractionData, type APIMessageButtonInteractionData, type APIMessageComponentInteraction, type APIMessageComponentSelectMenuInteraction, type APIMessageStringSelectInteractionData, type APIModalSubmission, type APIModalSubmitInteraction, type APIUserApplicationCommandInteraction, type APIUserApplicationCommandInteractionData, ApplicationCommandType, ComponentType, type GatewayInteractionCreateDispatchData, type InteractionCallbackData, type InteractionCallbackResourceActivity, InteractionResponseType, InteractionType, type MessageFlags, type ModalSubmitInsideLabelData, type RESTPostAPIInteractionCallbackJSONBody } from '../types'; import { type AllChannels } from './'; import { DiscordBase } from './extra/DiscordBase'; import { PermissionsBitField } from './extra/Permissions'; export type ReplyInteractionBody = { type: InteractionResponseType.Modal; data: ModalCreateBodyRequest; } | { type: InteractionResponseType.ChannelMessageWithSource | InteractionResponseType.UpdateMessage; data: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest | ComponentInteractionMessageUpdate; } | { type: InteractionResponseType.LaunchActivity; } | Exclude; export type __InternalReplyFunction = (_: { body: APIInteractionResponse; files?: RawFile[]; }) => Promise; export interface BaseInteraction extends ObjectToLower, 'user' | 'member' | 'message' | 'channel' | 'type' | 'app_permissions'>> { } export declare class BaseInteraction extends DiscordBase { readonly client: UsingClient; protected __reply?: __InternalReplyFunction | undefined; user: UserStructure; member: When; channel?: AllChannels; message?: MessageStructure; replied?: boolean; private _repliedPromise?; deferred?: boolean; appPermissions: PermissionsBitField; entitlements: EntitlementStructure[]; constructor(client: UsingClient, interaction: Type, __reply?: __InternalReplyFunction | undefined); static transformBodyRequest(body: ReplyInteractionBody, files: RawFile[] | undefined, self: UsingClient): APIInteractionResponse; static transformBody(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest | MessageUpdateBodyRequest | MessageCreateBodyRequest | MessageWebhookCreateBodyRequest, files: RawFile[] | undefined, self: UsingClient): T; private matchReplied; protected hasRepliedOrAwaitPendingReply(): Promise; reply(body: ReplyInteractionBody, withResponse?: WR): Promise>; deferReply(flags?: MessageFlags, withResponse?: WR): Promise>; isButton(): this is ButtonInteraction; isChannelSelectMenu(): this is ChannelSelectMenuInteraction; isRoleSelectMenu(): this is RoleSelectMenuInteraction; isMentionableSelectMenu(): this is MentionableSelectMenuInteraction; isUserSelectMenu(): this is UserSelectMenuInteraction; isStringSelectMenu(): this is StringSelectMenuInteraction; isChatInput(): this is ChatInputCommandInteraction; isUser(): this is UserCommandInteraction; isMessage(): this is MessageCommandInteraction; isAutocomplete(): this is AutocompleteInteraction; isModal(): this is ModalSubmitInteraction; isEntryPoint(): this is EntryPointInteraction; static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): ModalSubmitInteraction | ButtonInteraction | ChannelSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | UserSelectMenuInteraction | StringSelectMenuInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | AutocompleteInteraction | BaseInteraction; fetchGuild(mode?: 'rest' | 'flow'): Promise | undefined>; fetchGuild(mode: 'cache'): ReturnCache | undefined>; } export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | EntryPointInteraction | BaseInteraction; export interface AutocompleteInteraction extends ObjectToLower> { } export declare class AutocompleteInteraction extends BaseInteraction { protected __reply?: __InternalReplyFunction | undefined; type: InteractionType.ApplicationCommandAutocomplete; data: ObjectToLower; options: OptionResolverStructure; entitlements: EntitlementStructure[]; channel: AllChannels; constructor(client: UsingClient, interaction: APIApplicationCommandAutocompleteInteraction, resolver?: OptionResolverStructure, __reply?: __InternalReplyFunction | undefined); getInput(): string; respond(choices: APICommandAutocompleteInteractionResponseCallbackData['choices']): Promise; isAutocomplete(): this is AutocompleteInteraction; /** @intenal */ reply(..._args: unknown[]): Promise; } export declare class Interaction extends BaseInteraction { channel: AllChannels; fetchMessage(messageId: string): Promise; fetchResponse(): Promise; write(body: InteractionCreateBodyRequest, withResponse?: FR): Promise>; modal(body: ModalCreateBodyRequest, options?: undefined): Promise; modal(body: ModalCreateBodyRequest, options: ModalCreateOptions): Promise; editOrReply(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise>; editMessage(messageId: string, body: InteractionMessageUpdateBodyRequest): Promise; editResponse(body: InteractionMessageUpdateBodyRequest): Promise; deleteResponse(): Promise; deleteMessage(messageId: string): Promise; followup(body: MessageWebhookCreateBodyRequest): Promise; } export declare class ApplicationCommandInteraction extends Interaction { type: ApplicationCommandType; channel: AllChannels; respond(data: APIInteractionResponseChannelMessageWithSource | APIInteractionResponseDeferredChannelMessageWithSource | APIInteractionResponseDeferredMessageUpdate | APIInteractionResponseUpdateMessage): Promise; } /** * Seyfert don't support activities, so this interaction is blank */ export declare class EntryPointInteraction extends ApplicationCommandInteraction { channel: AllChannels; withResponse(data?: InteractionCreateBodyRequest): Promise; isEntryPoint(): this is EntryPointInteraction; } export interface EntryPointWithResponseResult { interaction: ObjectToLower; resource?: { type: InteractionResponseType.LaunchActivity; activityInstance: InteractionCallbackResourceActivity; } | { type: Exclude; message: WebhookMessageStructure; }; } export interface ComponentInteraction extends ObjectToLower> { } export declare class ComponentInteraction extends Interaction { data: ObjectToLower; channel: AllChannels; type: InteractionType.MessageComponent; message: MessageStructure; entitlements: EntitlementStructure[]; update(data: ComponentInteractionMessageUpdate): Promise; deferUpdate(): Promise; get customId(): string; get componentType(): ComponentType.Button | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect; } export declare class ButtonInteraction extends ComponentInteraction { data: ObjectToLower; isButton(): this is ButtonInteraction; } export declare class SelectMenuInteraction extends ComponentInteraction { protected __reply?: __InternalReplyFunction | undefined; data: ObjectToLower; channel: AllChannels; constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined); get values(): string[]; } declare const StringSelectMenuInteraction_base: ToClass, StringSelectMenuInteraction>; export declare class StringSelectMenuInteraction extends StringSelectMenuInteraction_base { data: OmitInsert, 'values', { values: T; }>; values: T; channel: AllChannels; isStringSelectMenu(): this is StringSelectMenuInteraction; } export declare class ChannelSelectMenuInteraction extends SelectMenuInteraction { protected __reply?: __InternalReplyFunction | undefined; channels: AllChannels[]; channel: AllChannels; constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined); isChannelSelectMenu(): this is ChannelSelectMenuInteraction; } export declare class MentionableSelectMenuInteraction extends SelectMenuInteraction { protected __reply?: __InternalReplyFunction | undefined; roles: GuildRoleStructure[]; members: InteractionGuildMemberStructure[]; users: UserStructure[]; channel: AllChannels; constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined); isMentionableSelectMenu(): this is MentionableSelectMenuInteraction; } export declare class RoleSelectMenuInteraction extends SelectMenuInteraction { protected __reply?: __InternalReplyFunction | undefined; roles: GuildRoleStructure[]; channel: AllChannels; constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined); isRoleSelectMenu(): this is RoleSelectMenuInteraction; } export declare class UserSelectMenuInteraction extends SelectMenuInteraction { protected __reply?: __InternalReplyFunction | undefined; members: InteractionGuildMemberStructure[]; users: UserStructure[]; channel: AllChannels; constructor(client: UsingClient, interaction: APIMessageComponentSelectMenuInteraction, __reply?: __InternalReplyFunction | undefined); isUserSelectMenu(): this is UserSelectMenuInteraction; } export declare class ChatInputCommandInteraction extends ApplicationCommandInteraction { data: ObjectToLower; channel: AllChannels; isChatInput(): this is ChatInputCommandInteraction; } export declare class UserCommandInteraction extends ApplicationCommandInteraction { type: ApplicationCommandType.User; data: ObjectToLower; channel: AllChannels; isUser(): this is UserCommandInteraction; } export declare class MessageCommandInteraction extends ApplicationCommandInteraction { type: ApplicationCommandType.Message; data: ObjectToLower; channel: AllChannels; isMessage(): this is MessageCommandInteraction; } export interface ModalSubmitInteraction extends Omit, 'modal'> { } export declare class ModalSubmitInteraction extends BaseInteraction { data: ObjectToLower; channel: AllChannels; update(data: ComponentInteractionMessageUpdate, withResponse?: WR): Promise>; deferUpdate(): Promise; get customId(): string; get components(): { type: ComponentType.Label; id?: number | undefined; component?: { type: ComponentType.FileUpload; values: string[]; id?: number | undefined; customId: string; } | { type: ComponentType.RadioGroup; value: string; id?: number | undefined; customId: string; } | { type: ComponentType.CheckboxGroup; values: string[]; id?: number | undefined; customId: string; } | { type: ComponentType.Checkbox; value: boolean; id?: number | undefined; customId: string; } | { type: ComponentType.TextInput; value: string; id?: number | undefined; customId: string; } | { type: ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect; values: string[]; id?: number | undefined; customId: string; } | undefined; }[]; getComponent(customId: string, type?: ComponentType[]): ObjectToLower | undefined; getChannels(customId: string, required: true): AllChannels[]; getChannels(customId: string, required?: false): AllChannels[] | void; getRoles(customId: string, required: true): GuildRoleStructure[]; getRoles(customId: string, required?: false): GuildRoleStructure[] | void; getUsers(customId: string, required: true): UserStructure[]; getUsers(customId: string, required?: false): UserStructure[] | void; getMentionables(customId: string, required: true): (UserStructure | GuildRoleStructure | InteractionGuildMemberStructure)[]; getMentionables(customId: string, required?: false): (UserStructure | GuildRoleStructure | InteractionGuildMemberStructure)[] | void; getRadioValues(customId: string, required: true): string; getRadioValues(customId: string, required?: false): string | void; /** * For checkbox groups. */ getCheckboxValues(customId: string, required: true): string[]; getCheckboxValues(customId: string, required?: false): string[] | void; getCheckbox(customId: string, required: true): boolean; getCheckbox(customId: string, required?: false): boolean | void; getInputValue(customId: string, required: true): string | string[]; getInputValue(customId: string, required?: false): string | string[] | undefined; getFiles(customId: string, required: true): Attachment[]; getFiles(customId: string, required?: false): Attachment[] | undefined; isModal(): this is ModalSubmitInteraction; } export {};