SlashCommand

SlashCommand

Represents a slash command.

Constructor

new SlashCommand(client, data)

Description:
  • Creates a slash command interaction structure.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw interaction data from Discord.

Extends

Members

(readonly, nullable) channel :TextChannel|VoiceChannel|Thread

Description:
  • The channel that this interaction belongs to.

Source:
Overrides:

The channel that this interaction belongs to.

Type:

(readonly) channelId :String

Description:
  • The id of the channel that this interaction belongs to.

Source:
Overrides:

The id of the channel that this interaction belongs to.

Type:
  • String

(readonly, nullable) data :Object

Description:
  • The raw slash command data from Discord.

Source:

The raw slash command data from Discord.

Type:
  • Object

(readonly, nullable) guild :Guild

Description:
  • The guild that this interaction belongs to.

Source:
Overrides:

The guild that this interaction belongs to.

Type:

(readonly) guildId :String

Description:
  • The id of the guild that this interaction belongs to.

Source:
Overrides:

The id of the guild that this interaction belongs to.

Type:
  • String

(readonly) id :String

Description:
  • The id of the interaction.

Source:
Overrides:

The id of the interaction.

Type:
  • String

(readonly, nullable) member :Member

Description:
  • The member that triggered the interaction, if it was run in a guild.

Source:
Overrides:

The member that triggered the interaction, if it was run in a guild.

Type:

(readonly) type :Number

Description:
  • The type of interaction.

Source:
Overrides:

The type of interaction.

Type:
  • Number

Methods

(async) acknowledge() → {Promise.<Interaction>}

Description:
  • Silently acknowledges an interaction.

Source:
Overrides:
Returns:
Type
Promise.<Interaction>

(async) autocompleteResponse(options) → {Promise.<Interaction>}

Description:
  • Responds to autocomplete interactions.

Source:
Overrides:
Parameters:
Name Type Description
options Object

Autocompletion options.

Throws:
Error
Returns:
Type
Promise.<Interaction>

(async) edit(contentnullable, optionsnullable) → {Promise.<Interaction>}

Description:
  • Edits a response to an interaction. Works up to 15 minutes after the response was sent.

Source:
Overrides:
Parameters:
Name Type Attributes Description
content String <nullable>

The new interaction response content.

options Object <nullable>

The new interaction response options.

Throws:
Error | TypeError
Returns:
Type
Promise.<Interaction>

(async) reply(contentnullable, optionsnullable) → {Promise.<Interaction>}

Description:
  • Replies to an interaction.

Source:
Overrides:
Parameters:
Name Type Attributes Description
content String <nullable>

The message content to send in the response to the interaction.

options Object <nullable>

An embed, components, and whether the response should be as an ephemeral message.

Returns:
Type
Promise.<Interaction>

(async) textPrompt(options) → {Promise.<void>}

Description:
  • Prompts a user to enter text using a modal.

Source:
Overrides:
Parameters:
Name Type Description
options Object

Modal options.

Throws:
Error | TypeError
Returns:
Type
Promise.<void>

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Overrides:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source:
Overrides: