Slash commands is a new feature added by Discord.
It let's users interact with your bot by typing
- Discord allows up to 50 slash commands.
- Before using slash commands you need to reinvite the bot with
- Creating/modifying/deleting slash command might take up to 1hr.
Before we start, you need 1.18.8 version of the app or later.
- Open the app
- Pick your bot
- Open navigation drawer and then press "Server invites"
- Press the button with eye icon.
- Select Slash commands
- Go back
- Press "Add your bot to your server"
- Invite the bot to your server
- Create or modify existing command
- Press the top-right icon
- Press "Enable slash command trigger"
- Fill in necessary data
- Save it
You can retrive a value from an option
by simply using
If you want this function to work in a normal and slash command
then you can use
$message[<arg number>;<option name>].
You can use
$isSlash which returns
true if a command
was executed by slash trigger, otherwise it returns