Class CommandInteraction<T>

Represents a command interaction.

Type Parameters

Hierarchy

Constructors

Properties

_cachedChannel: any
_cachedGuild?: any
acknowledged: boolean

If this interaction has been acknowledged.

appPermissions: T extends AnyTextableGuildChannel
    ? Permission
    : undefined | Permission

The permissions the bot has in the channel this interaction was sent from, if this interaction is sent from a guild.

application?: ClientApplication

The application this interaction is for.

applicationID: string

The ID of the application this interaction is for.

channelID: string

The ID of the channel this interaction was sent from.

The data associated with the interaction.

guildID: T extends AnyTextableGuildChannel
    ? string
    : null | string

The id of the guild this interaction was sent from, if applicable.

guildLocale: T extends AnyTextableGuildChannel
    ? string
    : undefined | string

The preferred locale of the guild this interaction was sent from, if applicable.

guildPartial?: T extends AnyTextableGuildChannel
    ? InteractionGuild
    : undefined | InteractionGuild

The partial guild this interaction was sent from, if applicable.

id: string
locale: string

The locale of the invoking user.

member: T extends AnyTextableGuildChannel
    ? Member
    : null | Member

The member associated with the invoking user, if this interaction is sent from a guild.

memberPermissions: T extends AnyTextableGuildChannel
    ? Permission
    : null | Permission

The permissions of the member associated with the invoking user, if this interaction is sent from a guild.

token: string

The token of this interaction.

The type of this interaction.

user: User

The user that invoked this interaction.

version: 1

Read-only property, always 1

Accessors

  • get channel(): T extends AnyInteractionChannel
        ? T
        : undefined
  • The channel this interaction was sent from.

    Returns T extends AnyInteractionChannel
        ? T
        : undefined

  • get createdAt(): Date
  • Returns Date

  • get guild(): T extends AnyTextableGuildChannel
        ? Guild
        : null | Guild
  • The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached.

    Returns T extends AnyTextableGuildChannel
        ? Guild
        : null | Guild

Methods

  • Create a followup message.

    Parameters

    Returns Promise<Message<T>>

  • Respond to this interaction with a modal. This is an initial response, and more than one initial response cannot be used.

    Parameters

    • options: ModalData

      The options for the modal.

    Returns Promise<void>

  • Defer this interaction. This is an initial response, and more than one initial response cannot be used.

    Parameters

    • Optional flags: number

      The flags to respond with.

    Returns Promise<void>

  • Delete a follow-up message.

    Parameters

    • messageID: string

      The ID of the message.

    Returns Promise<void>

  • Delete the original interaction response.

    Returns Promise<void>

  • Edit a followup message.

    Parameters

    • messageID: string

      The ID of the message.

    • options: InteractionContent

      The options for editing the followup message.

    Returns Promise<Message<T>>

  • Edit the original interaction response.

    Parameters

    Returns Promise<Message<T>>

  • Get a followup message.

    Parameters

    • messageID: string

      The ID of the message.

    Returns Promise<Message<T>>

  • Get the original interaction response.

    Returns Promise<Message<T>>

  • Whether this interaction belongs to a cached guild channel. The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to.

    Returns this is CommandInteraction<AnyTextableGuildChannel>

  • Whether this interaction belongs to a private channel (PrivateChannel or uncached). The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to.

    Returns this is CommandInteraction<PrivateChannel | Uncached>

  • Returns string

  • Parameters

    • data: unknown

    Returns void

  • Parameters

    • Optional timestamp: number | Date

    Returns string

  • Parameters

    • id: string

    Returns Date

  • Parameters

    • id: string

    Returns number

Generated using TypeDoc