Discord.https - v3.0.16
    Preparing search index...

    Represents a modal interaction

    Hierarchy

    Index

    Constructors

    Properties

    applicationId: string

    The ID of the application (bot) this interaction is for.

    appPermissions: Readonly<BitField>

    The permissions the application (bot) has in the interaction's channel.

    attachmentSizeLimit: number

    Maximum attachment size allowed for this interaction (in bytes).

    authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap
    channelId: null | string

    The ID of the channel this interaction was sent in.

    client: default

    The components within the modal

    context: null | number

    The context in which this interaction was triggered (e.g., direct message, command, etc.).

    customId: string

    The custom id of the modal.

    deferred: boolean = false

    Whether the reply to this interaction has been deferred

    entitlements: APIEntitlement[]
    ephemeral: null | boolean = null

    Whether the reply to this interaction is ephemeral

    guildId: null | string

    The ID of the guild this interaction was sent in (if applicable).

    guildLocale: null | Locale

    The preferred locale of the guild, if the interaction was in a guild.

    id: string

    The interaction's unique ID.

    locale: Locale

    The locale of the user invoking the interaction (e.g., "en-US").

    The guild member who invoked this interaction (if in a guild).

    memberPermissions: null | Readonly<BitField<Record<string, number>, number>>

    The permissions the invoking member has in the interaction's channel.

    message: null | APIMessage

    The message associated with this interaction

    replied: boolean = false

    Whether this interaction has already been replied to

    token: string

    The interaction token used for responding.

    The interaction's type.

    user: APIUser

    The user who invoked this interaction.

    version: number

    The interaction protocol version.

    An associated interaction webhook, can be used to further interact with this interaction

    Accessors

    Methods

    • Options for deferring the reply to an BaseInteraction.

      Parameters

      • options: Omit<
            djs.InteractionDeferReplyOptions,
            "ephemeral"
            | "fetchReply"
            | "withResponse",
        > = {}

      Returns void

      Only MessageFlags.Ephemeral can be set.

      // Defer the reply to this interaction
      interaction.deferReply()
      // Defer to send an ephemeral reply later
      interaction.deferReply({ flags: MessageFlags.Ephemeral })
    • Deletes a reply to this interaction.

      Parameters

      • message: string = "@original"

      Returns Promise<void>

      // Delete the initial reply to this interaction
      interaction.deleteReply()
      .then(console.log)
      .catch(console.error);
    • Fetches a reply to this interaction.

      Parameters

      • message: string = "@original"

      Returns Promise<APIMessage>

      // Fetch the initial reply to this interaction
      const replyMessage = await interaction.fetchReply();
      console.log(replyMessage.content