InteractionResponse
Defined in: packages/structures/src/interactions.ts:121
A Discord interaction callback payload.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InteractionResponse(
type,data?):InteractionResponse
Defined in: packages/structures/src/interactions.ts:127
Creates a response payload.
Parameters
Section titled “Parameters”number
Discord callback type.
Optional callback data.
Returns
Section titled “Returns”InteractionResponse
Throws
Section titled “Throws”If type is not finite.
Properties
Section titled “Properties”
readonlyoptionaldata?:InteractionReplyOptions
Defined in: packages/structures/src/interactions.ts:123
readonlytype:number
Defined in: packages/structures/src/interactions.ts:122
withResponse
Section titled “withResponse”withResponse:
boolean=false
Defined in: packages/structures/src/interactions.ts:125
Ask Discord to return the created message (?with_response=true); not part of the body.
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON():
object
Defined in: packages/structures/src/interactions.ts:134
Serializes the response for Discord.
Returns
Section titled “Returns”object
Discord callback payload.
optionaldata?:InteractionReplyOptions
type:
number
defer()
Section titled “defer()”
staticdefer(ephemeral?):InteractionResponse
Defined in: packages/structures/src/interactions.ts:152
Creates a deferred channel response.
Parameters
Section titled “Parameters”ephemeral?
Section titled “ephemeral?”boolean = false
Whether the eventual response is ephemeral.
Returns
Section titled “Returns”InteractionResponse
Callback payload.
message()
Section titled “message()”
staticmessage(options):InteractionResponse
Defined in: packages/structures/src/interactions.ts:143
Creates an immediate message response.
Parameters
Section titled “Parameters”options
Section titled “options”Response message options.
Returns
Section titled “Returns”InteractionResponse
Callback payload.
pong()
Section titled “pong()”
staticpong():InteractionResponse
Defined in: packages/structures/src/interactions.ts:159
Creates a Pong response.
Returns
Section titled “Returns”InteractionResponse
Callback payload.