-
Hi, Discord will force all bots to use slash commands starting this 31st August, therefore I want to ask is it possible to add the ability to trigger a slash command of a bot in a channel of a server? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Updated the script with Example to search for a command named {
id()
const guildId = gid
const channelId = cid
// Search a command named `rank`, pick the first result
const searchRes = await api.searchSlashCommand(channelId, 'rank')
const command = searchRes.application_commands[0]
// Get my rank, no command options
await api.sendSlashCommand(guildId, channelId, command)
// Get the rank of someone, pass the user in command options
await api.sendSlashCommand(guildId, channelId, command, [{ type: 6, name: 'member', value: '1234535821234567890' }])
} Note: The command search may return multiple If you are not sure what options you need to pass, simply open the Network tab of the devtools, manually send the command, then inspect the request Form Data (command options are in Please mark as answer |
Beta Was this translation helpful? Give feedback.
Updated the script with☺️
searchSlashCommand
andsendSlashCommand
!Example to search for a command named
/rank
and run it (with the MEE6 bot):Note: The command search may return m…