Constructor
new CommandInteraction()
Properties:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
appPermissions |
Permission
|
<nullable> |
The permissions the app or bot has within the channel the interaction was sent from |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
channel |
DMChannel
|
TextChannel
|
NewsChannel
|
The channel the interaction was created in. Can be partial with only the id if the channel is not cached |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data |
Object
|
The data attached to the interaction |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
String
|
The ID of the Application Command |
|||||||||||||||||
name |
String
|
The command name |
|||||||||||||||||
options |
Array.<Object>
|
<nullable> |
The run Application Command options |
||||||||||||||||
options[].name |
String
|
The name of the Application Command option |
|||||||||||||||||
options[].options |
Array.<Object>
|
<nullable> |
The run Application Command options (Mutually exclusive with value) |
||||||||||||||||
options[].type |
Number
|
Command option type, 1-10 |
|||||||||||||||||
options[].value |
String
|
Number
|
Boolean
|
<nullable> |
The value of the run Application Command (Mutually exclusive with options) |
||||||||||||||||
target_id |
String
|
<nullable> |
The ID the of user or message targetted by a context menu command |
||||||||||||||||
type |
Number
|
The command type |
|||||||||||||||||
resolved |
Object
|
<nullable> |
converted users + roles + channels |
||||||||||||||||
| Name | Type | Attributes | Description |
|---|---|---|---|
channels |
Collection.<Channel>
|
<nullable> |
converted channels |
members |
Collection.<Member>
|
<nullable> |
converted members |
roles |
Collection.<Role>
|
<nullable> |
converted roles |
users |
Collection.<User>
|
<nullable> |
converted users |
guildIDString
The ID of the guild in which the interaction was created
memberMember
The member who triggered the interaction (This is only sent when the interaction is invoked within a guild)
userUser
The user who triggered the interaction (This is only sent when the interaction is invoked within a dm)
- Source:
Extends
Methods
(async) acknowledge(flagsopt) → {Promise}
Acknowledges the interaction with a defer response Note: You can not use more than 1 initial interaction response per interaction
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
flags |
Number
|
<optional> |
64 for Ephemeral |
Returns:
- Type:
-
Promise
(async) createFollowup(content, fileopt) → {Promise.<?Message>}
Respond to the interaction with a followup message
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
String
|
Object
|
A string or object. If an object is passed:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options.embeds |
Array.<Object>
|
<optional> |
An array of embed objects. See the official Discord API documentation entry for object structure |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content.flags |
Number
|
<optional> |
64 for Ephemeral |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content.poll |
Object
|
<optional> |
A poll object. See the official Discord API documentation entry for object structure |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content.tts |
Boolean
|
<optional> |
Set the message TTS flag |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise.<?Message>
(async) createMessage(content, fileopt) → {Promise}
Acknowledges the interaction with a message. If already acknowledged runs createFollowup
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
String
|
Object
|
A string or object. If an object is passed:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise
(async) createModal(content) → {Promise}
Responds to an interaction with a modal
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
Object
|
An object
|
Returns:
- Type:
-
Promise
(async) defer(flagsopt) → {Promise}
Acknowledges the interaction with a defer response Note: You can not use more than 1 initial interaction response per interaction
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
flags |
Number
|
<optional> |
64 for Ephemeral |
Returns:
- Type:
-
Promise
(async) deleteMessage(messageID) → {Promise}
Delete a message
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
messageID |
String
|
the id of the message to delete, or "@original" for the original response |
Returns:
- Type:
-
Promise
(async) deleteOriginalMessage() → {Promise}
Delete the Original message Warning: Will error with ephemeral messages
- Source:
Returns:
- Type:
-
Promise
(async) editMessage(messageID, content, fileopt) → {Promise.<Message>}
Edit a message
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
messageID |
String
|
the id of the message to edit, or "@original" for the original response |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content |
Object
|
Interaction message edit options
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise.<Message>
(async) editOriginalMessage(content, fileopt) → {Promise.<Message>}
Edit the Original response message
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
Object
|
Interaction message edit options
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise.<Message>