Interaction
Documentation / @discordeno/bot / Interaction
Interface: Interaction
Defined in: transformers/types.ts:1070
Properties
acknowledged
acknowledged:
boolean
Defined in: transformers/types.ts:1074
Whether or not this interaction has been responded to.
applicationId
applicationId:
bigint
Defined in: transformers/types.ts:1078
Id of the application this interaction is for
appPermissions
appPermissions:
bigint
Defined in: transformers/types.ts:1112
The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites)
attachmentSizeLimit
attachmentSizeLimit:
number
Defined in: transformers/types.ts:1118
Attachment size limit in bytes
authorizingIntegrationOwners
authorizingIntegrationOwners:
Partial<Record<DiscordApplicationIntegrationType,bigint>>
Defined in: transformers/types.ts:1114
Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
bot
bot:
Bot
Defined in: transformers/types.ts:1072
The bot object
channel
channel:
Partial<Channel>
Defined in: transformers/types.ts:1086
The channel it was sent from
channelId?
optionalchannelId?:bigint
Defined in: transformers/types.ts:1093
The ID of channel it was sent from
Remarks
It is recommended that you begin using this channel field to identify the source channel of the interaction as they may deprecate the existing channel_id field in the future.
context?
optionalcontext?:DiscordInteractionContextType
Defined in: transformers/types.ts:1116
Context where the interaction was triggered from
data?
optionaldata?:InteractionData
Defined in: transformers/types.ts:1105
the command data payload
defer
defer: (
isPrivate?,options?) =>Promise<void|InteractionCallbackResponse>
Defined in: transformers/types.ts:1157
Defer the interaction for updating the response at a later time with edit.
Parameters
isPrivate?
boolean
options?
Returns
Promise<void | InteractionCallbackResponse>
Remarks
This will send a DeferredChannelMessageWithSource response.
deferEdit
deferEdit: (
options?) =>Promise<void|InteractionCallbackResponse>
Defined in: transformers/types.ts:1150
Defer the interaction for updating the referenced message at a later time with edit.
Parameters
options?
Returns
Promise<void | InteractionCallbackResponse>
Remarks
This will send a DeferredUpdateMessage response.
delete
delete: (
messageId?) =>Promise<void>
Defined in: transformers/types.ts:1159
Delete the original interaction response or a followup if the message id is provided.
Parameters
messageId?
Returns
Promise<void>
edit
edit: (
response,messageId?,options?) =>Promise<void|Message|InteractionCallbackResponse>
Defined in: transformers/types.ts:1139
Edit the original response of an interaction or a followup if the message id is provided.
Parameters
response
string | InteractionCallbackData
messageId?
options?
Returns
Promise<void | Message | InteractionCallbackResponse>
Remarks
This will edit the original interaction response or, if the interaction has not yet been acknowledged and the type of the interaction is MessageComponent it will instead send a UpdateMessage response instead.
entitlements
entitlements:
Entitlement[]
Defined in: transformers/types.ts:1110
For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
guild?
optionalguild?:Partial<Guild>
Defined in: transformers/types.ts:1082
Guild that the interaction was sent from
guildId?
optionalguildId?:bigint
Defined in: transformers/types.ts:1084
The guild it was sent from
guildLocale?
optionalguildLocale?:string
Defined in: transformers/types.ts:1108
The guild's preferred locale, if invoked in a guild
id
id:
bigint
Defined in: transformers/types.ts:1076
Id of the interaction
locale?
optionallocale?:string
Defined in: transformers/types.ts:1106
member?
optionalmember?:Member
Defined in: transformers/types.ts:1095
Guild member data for the invoking user, including permissions
message?
optionalmessage?:Message
Defined in: transformers/types.ts:1103
For components or modals triggered by components, the message they were attached to
respond
respond: (
response,options?) =>Promise<void|Message|InteractionCallbackResponse>
Defined in: transformers/types.ts:1127
Sends a response to an interaction.
Parameters
response
string | InteractionCallbackData
options?
isPrivate?
boolean
type?
withResponse?
boolean
Returns
Promise<void | Message | InteractionCallbackResponse>
Remarks
If you did not provide a response type, this will send a ChannelMessageWithSource, ApplicationCommandAutocompleteResult or Modal response based on the type of the interaction you are responding to.
If the interaction has been already acknowledged, indicated by Interaction.acknowledged, it will send a followup message instead.
sendFollowupMessage
sendFollowupMessage: (
response) =>Promise<Message>
Defined in: transformers/types.ts:1132
Sends a followup message to an interaction.
Parameters
response
string | InteractionCallbackData
Returns
Promise<Message>
token
token:
string
Defined in: transformers/types.ts:1099
A continuation token for responding to the interaction
type
type:
InteractionTypes
Defined in: transformers/types.ts:1080
The type of interaction
user
user:
User
Defined in: transformers/types.ts:1097
User object for the invoking user, if invoked in a DM
version
version:
1
Defined in: transformers/types.ts:1101
Read-only property, always 1