Constructor
new Interaction()
- Source
const Interaction = new Interaction(request, client, response);
Members
applicationId :number
ID of the application this interaction is for
- number
- Source
appPermissions :number
bitwise set of permissions the app or bot has within the channel the interaction was sent from
- number
channelId :number
channel that the interaction was sent from
- number
- Source
client :object
the client that is bound to the interaction
- object
- Source
commandName :string|null
interaction command name
- string |
null
- Source
customId :string|null
interaction custom id
- string |
null
- Source
data :object
interaction data payload
- object
- Source
data :Array
the interaction option data
- Array
guild :object
the guild data of the interaction
- object
- Source
id :number
ID of the interaction
- number
- Source
locale :number
selected language of the invoking user
- number
member :object
the member data of the interaction
- object
- Source
options :InteractionOptions
Return the options of the interaction
- InteractionOptions
- Source
token :string
continuation token for responding to the interaction
- string
- Source
type :number
type of interaction
- number
- Source
user :User
the user data of the interaction
Methods
deferReply(ephemeral)
Reply with deferred message
Name | Type | Default | Description |
---|---|---|---|
ephemeral | boolean | false | if the message should be ephemeral |
interaction.deferReply(true); // true or false to make it ephemeral
editReply()
Edit the Reply
Type | Description |
---|---|
const response = await interaction.editReply({ content: "Hello World" });
console.log(response);
getAttachmentOption() → {InteractionOptionsType.structure}
Get the interaction option "Attachment"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getBooleanOption() → {InteractionOptionsType.structure}
Get the interaction option "Boolean"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getChannelOption() → {InteractionOptionsType.structure}
Get the interaction option "Channel"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getIntegerOption() → {InteractionOptionsType.structure}
Get the interaction option "String"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getMentionableOption() → {InteractionOptionsType.structure}
Get the interaction option "Mentionable"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getNumberOption() → {InteractionOptionsType.structure}
Get the interaction option "Number"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getOptions() → {Array}
Get the interaction option "Attachment"
- Type:
- Array
getRoleOption() → {InteractionOptionsType.structure}
Get the interaction option "Role"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getStringOption() → {InteractionOptionsType.structure}
Get the interaction option "String"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getSubCommand() → {InteractionOptionsType.structure}
Get the interaction option "Sub Command"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getSubCommandGroup() → {InteractionOptionsType.structure}
Get the interaction option "Sub Command Group"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
getUserOption() → {InteractionOptionsType.structure}
Get the interaction option "User"
Name | Type | Description |
---|---|---|
name | String | The name of the option |
- Type:
- InteractionOptionsType.
structure
isAutoComplete()
Check if the interaction is an auto complete
isCommand()
Check if the interaction is an application command
isComponent()
Check if the interaction is a message component
isModal()
Check if the interaction is a modal submit
reply()
Reply to an Interaction
Type | Description |
---|---|
interaction.reply({ content: "Hello World" });
update(options)
Update an Interaction
Name | Type | Description |
---|---|---|
options | The message payload (embeds, components, content, files) |
interaction.update({ content: "Hello World" });