Skip to main content

Client-side Interactions

OP 24 'Request Interactions'

Used by the client to retreive a list of interactions. Gateway responds with GUILD_APPLICATION_COMMANDS_UPDATE event.

fieldtypedescription
applicationsbooleanfalse when using slash commands (documentation needed)
guild_idsnowflakeID of guild to query interactions for
limitintegerHow many interactions to return
noncestringNonce, used for the event returning the data
offsetinteger0-indexed offset for retrieving interactions

GUILD_APPLICATION_COMMANDS_UPDATE event

Returns the data for OP 24

fieldtypedescription
application_commandslist[ApplicationCommand]list of application commands
applicationslist[Application]list of applications
guild_idsnowflakethe same id used in OP 24
noncestringthe same nonce used in OP 24
updated_atunix timestampwhen the interactions were updated. this is not relative to the discord epoch

Application

fieldtypedescription
botBotpartial user structure of the bot
command_countintegerhow many application commands does this application have
iconstringavatar hash of the application
idsnowflakeid of the application
namestringname of the application

Bot

fieldtypedescription
avatarstringavatar hash
botbooleanalways true
discriminatorstringdiscriminator of the bot
idsnowflakeid of the bot
public_flagsintegerflags of the bot (check discord official docs)
usernamestringusername of the bot

ApplicationCommand

fieldtypedescription
application_idstringid of the app who owns this command
default_permissionbooleanwhether the command is enabled by default in this guild
descriptionstringdescription of this command (1-100 characters)
idsnowflakeid of this command
namestringname of this command (1-32 lowercase characters)
permissionslist[ApplicationCommandPermission]the permissions for the command in the guild
versionsnowflake??? (documentation needed)

POST /interactions

Use an interaction. Takes a InteractionBody and responds with 204. Also sends gateway events INTERACTION_CREATE and INTERACTION_SUCCESS/INTERACTION_FAILURE.

InteractionBody

fieldtypedescription
application_idsnowflakeid of application to use command for
channel_idsnowflakeid of the channel of the interaction
dataInteractionBodyDatadata of the interaction
?guild_idsnowflakeif interaction was in a guild, its id
noncestringnonce for responding in interaction create and success events
typeinteger??? (documentation needed) with slash commands, type = 2

INTERACTION_CREATE event

Responds to /interactions. data: InteractionResponseBody

INTERACTION_SUCCESS event

Sent after INTERACTION_CREATE if the event was successful. data: InteractionResponseBody

INTERACTION_FAILED event

Sent after INTERACTION_CREATE if the event failed. data: InteractionResponseBody

InteractionResponseBody

fieldtypedescription
idsnowflakemaybe id of this event (???) (documentation needed)
noncesnowflakenonce in POST /interactions