@typed-discord/interactions
    Preparing search index...

    Interface Handlers

    Handlers for all supported interaction events.

    interface Handlers {
        onGlobalAutocomplete: (
            name: string,
            focusedOptionName: string,
            focusedOptionValue: string,
            notFocusedOptions: Record<string, string | boolean | number>,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => AutocompleteResponse;
        onGlobalMessageCommand: (
            name: string,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onGlobalSlashCommand: (
            name: string,
            options: ResolvedOptions,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onGlobalUserCommand: (
            name: string,
            member_or_user: GuildMemberResponse | UserResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onGuildAutocomplete: (
            guild_id: `${bigint}`,
            name: string,
            focusedOptionName: string,
            focusedOptionValue: string,
            notFocusedOptions: Record<string, string | boolean | number>,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => AutocompleteResponse;
        onGuildMessageCommand: (
            guild_id: `${bigint}`,
            name: string,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onGuildSlashCommand: (
            guild_id: `${bigint}`,
            name: string,
            options: ResolvedOptions,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onGuildUserCommand: (
            guild_id: `${bigint}`,
            name: string,
            member_or_user: GuildMemberResponse | UserResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ) => ApplicationCommandResponse;
        onButtonClick(
            custom_id: string,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
        onChannelSelect(
            custom_id: string,
            channels: PartialChannel[],
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
        onMentionableSelect(
            custom_id: string,
            mentions: (GuildMemberResponse | UserResponse | GuildRoleResponse)[],
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
        onModalSubmit(
            custom_id: string,
            components: Record<string, ResolvedModalValue>,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ModalSubmitResponse;
        onModalSubmitFromMessage(
            custom_id: string,
            components: Record<string, ResolvedModalValue>,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ModalSubmitFromMessageResponse;
        onPing(): PingResponse;
        onRoleSelect(
            custom_id: string,
            roles: GuildRoleResponse[],
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
        onStringSelect(
            custom_id: string,
            strings: string[],
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
        onUserSelect(
            custom_id: string,
            users: (GuildMemberResponse | UserResponse)[],
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): MessageComponentResponse;
    }
    Index

    Properties

    onGlobalAutocomplete: (
        name: string,
        focusedOptionName: string,
        focusedOptionValue: string,
        notFocusedOptions: Record<string, string | boolean | number>,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => AutocompleteResponse

    Handle a global autocomplete interaction.

    Type Declaration

      • (
            name: string,
            focusedOptionName: string,
            focusedOptionValue: string,
            notFocusedOptions: Record<string, string | boolean | number>,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): AutocompleteResponse
      • Parameters

        • name: string

          The resolved command name, including subcommand path.

        • focusedOptionName: string

          The name of the currently focused option.

        • focusedOptionValue: string

          The current value of the focused option.

        • notFocusedOptions: Record<string, string | boolean | number>

          The values of the remaining unfocused options.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns AutocompleteResponse

    onGlobalMessageCommand: (
        name: string,
        message: MessageResponse,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a global message context menu interaction.

    Type Declaration

      • (
            name: string,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • name: string

          The name of the invoked message command.

        • message: MessageResponse

          The resolved target message.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    onGlobalSlashCommand: (
        name: string,
        options: ResolvedOptions,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a global slash command interaction.

    Type Declaration

      • (
            name: string,
            options: ResolvedOptions,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • name: string

          The resolved command name, including subcommand path.

        • options: ResolvedOptions

          The resolved command options.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    onGlobalUserCommand: (
        name: string,
        member_or_user: GuildMemberResponse | UserResponse,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a global user context menu interaction.

    Type Declaration

      • (
            name: string,
            member_or_user: GuildMemberResponse | UserResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • name: string

          The name of the invoked user command.

        • member_or_user: GuildMemberResponse | UserResponse

          The resolved target member or user.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    onGuildAutocomplete: (
        guild_id: `${bigint}`,
        name: string,
        focusedOptionName: string,
        focusedOptionValue: string,
        notFocusedOptions: Record<string, string | boolean | number>,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => AutocompleteResponse

    Handle a guild-specific autocomplete interaction.

    Type Declaration

      • (
            guild_id: `${bigint}`,
            name: string,
            focusedOptionName: string,
            focusedOptionValue: string,
            notFocusedOptions: Record<string, string | boolean | number>,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): AutocompleteResponse
      • Parameters

        • guild_id: `${bigint}`

          The ID of the guild where the autocomplete request originated.

        • name: string

          The resolved command name, including subcommand path.

        • focusedOptionName: string

          The name of the currently focused option.

        • focusedOptionValue: string

          The current value of the focused option.

        • notFocusedOptions: Record<string, string | boolean | number>

          The values of the remaining unfocused options.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns AutocompleteResponse

    onGuildMessageCommand: (
        guild_id: `${bigint}`,
        name: string,
        message: MessageResponse,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a guild-specific message context menu interaction.

    Type Declaration

      • (
            guild_id: `${bigint}`,
            name: string,
            message: MessageResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • guild_id: `${bigint}`

          The ID of the guild where the interaction occurred.

        • name: string

          The name of the invoked message command.

        • message: MessageResponse

          The resolved target message.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    onGuildSlashCommand: (
        guild_id: `${bigint}`,
        name: string,
        options: ResolvedOptions,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a guild-specific slash command interaction.

    Type Declaration

      • (
            guild_id: `${bigint}`,
            name: string,
            options: ResolvedOptions,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • guild_id: `${bigint}`

          The ID of the guild where the command was invoked.

        • name: string

          The resolved command name, including subcommand path.

        • options: ResolvedOptions

          The resolved command options.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    onGuildUserCommand: (
        guild_id: `${bigint}`,
        name: string,
        member_or_user: GuildMemberResponse | UserResponse,
        interaction:
            | GuildInteraction
            | BotDirectMessageInteraction
            | PrivateMessageInteraction,
    ) => ApplicationCommandResponse

    Handle a guild-specific user context menu interaction.

    Type Declaration

      • (
            guild_id: `${bigint}`,
            name: string,
            member_or_user: GuildMemberResponse | UserResponse,
            interaction:
                | GuildInteraction
                | BotDirectMessageInteraction
                | PrivateMessageInteraction,
        ): ApplicationCommandResponse
      • Parameters

        • guild_id: `${bigint}`

          The ID of the guild where the interaction occurred.

        • name: string

          The name of the invoked user command.

        • member_or_user: GuildMemberResponse | UserResponse

          The resolved target member or user.

        • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

          The original interaction payload.

        Returns ApplicationCommandResponse

    Methods

    • Handle a button component interaction.

      Parameters

      • custom_id: string

        The button custom identifier.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse

    • Handle a channel select component interaction.

      Parameters

      • custom_id: string

        The select menu custom identifier.

      • channels: PartialChannel[]

        The selected channels.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse

    • Handle a mentionable select component interaction.

      Parameters

      • custom_id: string

        The select menu custom identifier.

      • mentions: (GuildMemberResponse | UserResponse | GuildRoleResponse)[]

        The selected mentionable users, members, or roles.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse

    • Handle a modal submit interaction that is not bound to a message.

      Parameters

      • custom_id: string

        The modal custom identifier.

      • components: Record<string, ResolvedModalValue>

        The resolved modal components.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns ModalSubmitResponse

    • Handle a modal submit interaction that is associated with a message.

      Parameters

      • custom_id: string

        The modal custom identifier.

      • components: Record<string, ResolvedModalValue>

        The resolved modal components.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns ModalSubmitFromMessageResponse

    • Handle a role select component interaction.

      Parameters

      • custom_id: string

        The select menu custom identifier.

      • roles: GuildRoleResponse[]

        The selected roles.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse

    • Handle a string select component interaction.

      Parameters

      • custom_id: string

        The select menu custom identifier.

      • strings: string[]

        The selected string values.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse

    • Handle a user select component interaction.

      Parameters

      • custom_id: string

        The select menu custom identifier.

      • users: (GuildMemberResponse | UserResponse)[]

        The selected users or members.

      • message: MessageResponse

        The message associated with the interaction.

      • interaction: GuildInteraction | BotDirectMessageInteraction | PrivateMessageInteraction

        The original interaction payload.

      Returns MessageComponentResponse