seyfert
    Preparing search index...

    Class ModalContext<M>

    Represents a context for interacting with components in a Discord bot.

    The type of component interaction.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    client: UsingClient

    The UsingClient instance.

    command: ModalCommand
    globalMetadata: GlobalMetadata = {}

    The component interaction object.

    metadata: CommandMetadata<UnionToTuple<M, []>> = ...

    Accessors

    • get components(): {
          components: { customId: string; type: ComponentType; value: string }[];
          type: ActionRow;
      }[]

      Returns {
          components: { customId: string; type: ComponentType; value: string }[];
          type: ActionRow;
      }[]

    Methods

    • Defers the reply to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • ephemeral: boolean = false

        Whether the reply should be ephemeral or not.

      • OptionalfetchReply: FR

      Returns Promise<When<FR, WebhookMessage, undefined>>

    • Deletes the response of the interaction.

      Returns Promise<void>

      A promise that resolves when the response is deleted.

    • Edits the response or replies to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • body:
            | Omit<
                APIInteractionResponseCallbackData,
                "components"
                | "content"
                | "embeds"
                | "poll",
            > & SendResolverProps
            | InteractionMessageUpdateBodyRequest

        The body of the response or updated body of the interaction.

      • OptionalfetchReply: FR

        Whether to fetch the reply or not.

      Returns Promise<When<FR, WebhookMessage, void>>

    • Parameters

      • body: Omit<
            RESTPostAPIWebhookWithTokenJSONBody,
            "components"
            | "content"
            | "embeds"
            | "poll",
        > & SendResolverProps

      Returns Promise<WebhookMessage>

    • Gets the guild of the interaction.

      Parameters

      • Optionalmode: "rest" | "flow"

        The mode to fetch the guild.

      Returns Promise<undefined | Guild<"cached" | "api">>

      A promise that resolves to the guild.

    • Gets the guild of the interaction.

      Parameters

      • mode: "cache"

        The mode to fetch the guild.

      Returns ReturnCache<undefined | Guild<"cached">>

      A promise that resolves to the guild.

    • Writes a response to the interaction.

      Type Parameters

      • FR extends boolean = false

      Parameters

      • body: Omit<
            APIInteractionResponseCallbackData,
            "components"
            | "content"
            | "embeds"
            | "poll",
        > & SendResolverProps

        The body of the response.

      • OptionalfetchReply: FR

        Whether to fetch the reply or not.

      Returns Promise<When<FR, WebhookMessage, void>>