Skip to main content

Interaction

@discordeno/botDocs


Documentation / @discordeno/bot / Interaction

Interface: Interaction

Properties

acknowledged

acknowledged: boolean

Whether or not this interaction has been responded to.

Defined in

packages/bot/src/transformers/types.ts:829


applicationId

applicationId: bigint

Id of the application this interaction is for

Defined in

packages/bot/src/transformers/types.ts:833


appPermissions

appPermissions: bigint

The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites)

Defined in

packages/bot/src/transformers/types.ts:865


authorizingIntegrationOwners

authorizingIntegrationOwners: Partial<Record<DiscordApplicationIntegrationType, bigint>>

Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.

Defined in

packages/bot/src/transformers/types.ts:867


bot

bot: Bot<TransformersDesiredProperties, RemoveKey>

The bot object

Defined in

packages/bot/src/transformers/types.ts:827


channel

channel: Partial<Channel>

The channel it was sent from

Defined in

packages/bot/src/transformers/types.ts:841


channelId?

optional channelId: bigint

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.

Defined in

packages/bot/src/transformers/types.ts:848


context?

optional context: DiscordInteractionContextType

Context where the interaction was triggered from

Defined in

packages/bot/src/transformers/types.ts:869


data?

optional data: InteractionData

the command data payload

Defined in

packages/bot/src/transformers/types.ts:860


defer()

defer: (isPrivate?, options?) => Promise<void | InteractionCallbackResponse>

Defer the interaction for updating the response at a later time with edit.

Parameters

isPrivate?: boolean

options?: InteractionCallbackOptions

Returns

Promise<void | InteractionCallbackResponse>

Remarks

This will send a DeferredChannelMessageWithSource response.

Defined in

packages/bot/src/transformers/types.ts:906


deferEdit()

deferEdit: (options?) => Promise<void | InteractionCallbackResponse>

Defer the interaction for updating the referenced message at a later time with edit.

Parameters

options?: InteractionCallbackOptions

Returns

Promise<void | InteractionCallbackResponse>

Remarks

This will send a DeferredUpdateMessage response.

Defined in

packages/bot/src/transformers/types.ts:899


delete()

delete: (messageId?) => Promise<void>

Delete the original interaction response or a followup if the message id is provided.

Parameters

messageId?: BigString

Returns

Promise<void>

Defined in

packages/bot/src/transformers/types.ts:908


edit()

edit: (response, messageId?, options?) => Promise<void | InteractionCallbackResponse | Message>

Edit the original response of an interaction or a followup if the message id is provided.

Parameters

response: string | InteractionCallbackData

messageId?: BigString

options?: InteractionCallbackOptions

Returns

Promise<void | InteractionCallbackResponse | Message>

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.

Defined in

packages/bot/src/transformers/types.ts:888


guild

guild: Guild

Guild that the interaction was sent from

Defined in

packages/bot/src/transformers/types.ts:837


guildId?

optional guildId: bigint

The guild it was sent from

Defined in

packages/bot/src/transformers/types.ts:839


guildLocale?

optional guildLocale: string

The guild's preferred locale, if invoked in a guild

Defined in

packages/bot/src/transformers/types.ts:863


id

id: bigint

Id of the interaction

Defined in

packages/bot/src/transformers/types.ts:831


locale?

optional locale: string

Defined in

packages/bot/src/transformers/types.ts:861


member?

optional member: Member

Guild member data for the invoking user, including permissions

Defined in

packages/bot/src/transformers/types.ts:850


message?

optional message: Message

For the message the button was attached to

Defined in

packages/bot/src/transformers/types.ts:858


respond()

respond: (response, options?) => Promise<void | InteractionCallbackResponse | Message>

Sends a response to an interaction.

Parameters

response: string | InteractionCallbackData

options?

options.isPrivate?: boolean

options.withResponse?: boolean

Returns

Promise<void | InteractionCallbackResponse | Message>

Remarks

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.

Defined in

packages/bot/src/transformers/types.ts:878


token

token: string

A continuation token for responding to the interaction

Defined in

packages/bot/src/transformers/types.ts:854


type

type: InteractionTypes

The type of interaction

Defined in

packages/bot/src/transformers/types.ts:835


user

user: User

User object for the invoking user, if invoked in a DM

Defined in

packages/bot/src/transformers/types.ts:852


version

version: 1

Read-only property, always 1

Defined in

packages/bot/src/transformers/types.ts:856