Interaction

Interaction

Represents an interaction received over the gateway.

Constructor

new Interaction(client, data)

Description:
  • Creates the structure for an interaction.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The interaction data from Discord.

Members

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

Description:
  • The channel that this interaction belongs to.

Source:

The channel that this interaction belongs to.

Type:

(readonly) channelId :String

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

Source:

The id of the channel that this interaction belongs to.

Type:
  • String

(readonly, nullable) guild :Guild

Description:
  • The guild that this interaction belongs to.

Source:

The guild that this interaction belongs to.

Type:

(readonly) guildId :String

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

Source:

The id of the guild that this interaction belongs to.

Type:
  • String

(readonly) id :String

Description:
  • The id of the interaction.

Source:

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:

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

Type:

(readonly) type :Number

Description:
  • The type of interaction.

Source:

The type of interaction.

Type:
  • Number

Methods

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

Description:
  • Silently acknowledges an interaction.

Source:
Returns:
Type
Promise.<Interaction>

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

Description:
  • Responds to autocomplete interactions.

Source:
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:
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:
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:
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:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: