Results

Namespace

Type

Information contained in a Slash Command interaction request from Discord.

Hierarchy

  • SlashCommandInteraction <-- You are here!

Index

Properties

Readonly channelId

channelId: Snowflake

The ID of the channel this command occurred in.

Readonly commandId

commandId: Snowflake

Readonly commandName

commandName: Snowflake

Readonly guildId

guildId: Snowflake

The ID of the guild this command occurred in.

Readonly id

The unique ID for this interaction event.

Readonly member

member: GuildMember

A reference to the member that performed the command.

Methods

acknowledge

  • acknowledge(options: IAcknowledgeOptions): Promise<void>
  • Manually acknowledges an interaction, using the options passed in the first argument.

    Usually used in combination with ICommandConfig.ackBehavior set to MANUAL.

    Parameters

    Returns Promise<void>

  • acknowledge(showSourceMessage: boolean): Promise<void>
  • deprecated

    Since the end of Discord's Slash Command Developer Beta (3/25/2021), source messages always show. Switch to passing IAcknowledgeOptions instead.

    Parameters

    • showSourceMessage: boolean

    Returns Promise<void>

deleteOriginal

  • deleteOriginal(): Promise<void>
  • Deletes the original response message, if sent.

    This function will error if called before acknowledging the command interaction.

    Returns Promise<void>

editOriginal

  • editOriginal(response: string | IResponseMessageOptions): Promise<void>
  • Edits the original response message, if sent.

    This function will error if called before acknowledging the command interaction.

    Parameters

    Returns Promise<void>

getChannel

  • getChannel(): Promise<GuildChannel>
  • Retrieves the channel object for the channel this command was ran in.

    Returns Promise<GuildChannel>

getGuild

  • getGuild(): Promise<Guild>
  • Retrieves the guild object for the guild this command was ran on.

    Returns Promise<Guild>

respond

respondEphemeral

  • respondEphemeral(response: string | IResponseMessageOptions): Promise<void>
  • Responds with a message seen only by the invoker of the command.

    Once sent, ephemeral replies may not be edited or deleted. As such, this function's return type is void.

    This is useful for instances where you don't need to announce the reply to all users in the channel.

    Parameters

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc