Takes a list of application commands, overwriting existing commands that are registered globally for this application. Updates will be available in all guilds after 1 hour
An Array of application command objects
const client = new SnowTransfer("TOKEN")
const commands = await client.interaction.bulkOverwriteApplicationCommands("appId", [{ name: "test", description: "testing 1, 2, 3" }])
The Id of the application
Array of commands
Takes a list of application commands, overwriting existing commands for the guild
An Array of application command objects
const client = new SnowTransfer("TOKEN")
const commands = await client.interaction.bulkOverwriteGuildApplicationCommands("appId", "guildId", [{ name: "test", description: "testing 1, 2, 3" }])
The Id of the application
The Id of the guild
Array of commands
Create a new global command. New global commands will be available in all guilds after 1 hour
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.createApplicationCommand("appId", { name: "test", description: "testing 1, 2, 3" })
The Id of the application
The command data
Create a followup message for an Interaction
A message object
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
const message = await client.interaction.createFollowupMessage("appId", "token", { content: "The pacer gram fitness test-" })
The Id of the application
The token of the interaction
Message data
Create a new guild command. New guild commands will be available in the guild immediately.
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.createGuildApplicationCommand("appId", "guildId", { name: "test", description: "testing 1, 2, 3" })
The Id of the application
The Id of the guild
Command data
Create a response to an Interaction
When uploading attachments to respond to message interactions, you must provide the top level files property which needs to match attachments array length and each element needs to match the same indexes as where their filename is defined (the top level files property gets deleted before it's appended to payload_json). Should you have a more elegant solution, possibly rewriting the interface with the request handler, please submit a PR/issue.
Resolves the Promise on successful execution
// Respond to a message interaction
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
client.interaction.createInteractionResponse("interactionId", "token", { type: 4, data: { content: "Hello World" } })
The Id of the interaction
The token of the interaction
Response data
Deletes a global command
Resolves the Promise on successful execution
const client = new SnowTransfer("TOKEN")
client.interaction.deleteApplicationCommand("appId", "cmdId")
The Id of the application
The Id of the command
Deletes a followup message for an Interaction
Resolves the Promise on successful execution
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
client.interaction.deleteFollowupMessage("appId", "token", "messageId")
The Id of the application
The token of the interaction
The Id of the message
Delete a guild command
Resolves the Promise on successful execution
const client = new SnowTransfer("TOKEN")
client.interaction.deleteGuildApplicationCommand("appId", "guildId", "cmdId")
The Id of the application
The Id of the guild
The Id of the command
Deletes the initial Interaction response
Resolves the Promise on successful execution
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
client.interaction.deleteOriginalInteractionResponse("appId", "token")
The Id of the application
The token of the interaction
Edit a global command. Updates will be available in all guilds after 1 hour
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.editApplicationCommand("appId", "cmdId", { name: "cool", description: "tells you how cool you are" })
The Id of the application
The Id of the command
The command data
Edits a followup message for an Interaction
A message object
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
const message = await client.interaction.editFollowupMessage("appId", "token", "messageId", { content: "-is a multistage aerobic capacity test" })
The Id of the application
The token of the interaction
The Id of the message
The new message data
Edit a guild command. Updates for guild commands will be available immediately.
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.editGuildApplicationCommand("appId", "guildId", "cmdId", { name: "coolest", description: "tells you that you are the coolest" })
The Id of the application
The Id of the guild
The Id of the command
New command data
Edits command permissions for a specific command for your application in a guild. You can only add up to 10 permission overwrites for a command.
A guild application command permission object
const client = new SnowTransfer("TOKEN")
const permissions = await client.interaction.editGuildApplicationCommandPermissions("appId", "guildId", "cmdId", [{ type: 2, id: "userId", permission: true }])
The Id of the application
The Id of the guild
The Id of the command
New application command permissions data
Edits the initial Interaction response
A message object
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
const message = await client.interaction.editOriginalInteractionResponse("appId", "token", { content: "The world said hello back" })
The Id of the application
The token of the interaction
New response data
Fetch a global command for your application
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.getApplicationCommand("appId", "cmdId")
The Id of the application
The Id of the command
Fetch all global commands for your application
An Array of application command objects
const client = new SnowTransfer("TOKEN")
const commands = await client.interaction.getApplicationCommands("appId")
The Id of the application
Optional
withLocalizations: booleanWhether or not to include localizations
Get a followup message for an Interaction
A message object
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
const message = await client.interaction.getFollowupMessage("appId", "token", "messageId")
The Id of the application
The token of the interaction
The Id of the message
Fetch a guild command for your application
An application command object
const client = new SnowTransfer("TOKEN")
const command = await client.interaction.getGuildApplicationCommand("appId", "guildId", "cmdId")
The Id of the application
The Id of the guild
The Id of the command
Fetches command permissions for all or a specific command for your application in a guild
An Array or single guild application command permission objects
// Gets all commands' permissions
const client = new SnowTransfer("TOKEN")
const permissions = await client.interaction.getGuildApplicationCommandPermissions("appId", "guildId")
// Gets a specific command's permissions
const client = new SnowTransfer("TOKEN")
const permissions = await client.interaction.getGuildApplicationCommandPermissions("appId", "guildId", "cmdId")
The Id of the application
The Id of the guild
Fetch all of the guild commands for your application for a specific guild.
An Array of application command objects
const client = new SnowTransfer("TOKEN")
const commands = await client.interaction.getGuildCommands("appId", "guildId", true)
The Id of the application
The Id of the guild
Optional
withLocalizations: booleanWhether or not to include localizations
Returns the initial Interaction response
A message object
const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
const message = await client.interaction.getOriginalInteractionResponse("appId", "token")
The Id of the application
The token of the interaction
Create a new Interaction Method Handler
Usually SnowTransfer creates a method handler for you, this is here for completion
You can access the methods listed via client.interaction.method
, where client
is an initialized SnowTransfer instance
request handler that calls the rest api
Generated using TypeDoc
Methods for interacting with slash command specific endpoints