Creating slash command with options and sapphire cli template
Hey there. I'm using the bot template from the sapphire cli and now wanted to try and create a slash command with options, but sadly don't know how to start. As I read the docs already, I know there's documentation at discord.js, but it doesn't apply to the template of the cli. Therefore any help with sapphire cli template in mind would be grateful.
Solution:Jump to solution
After many time reading through everything I found the solution:
https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands...
Sapphire Framework
Registering Chat Input Commands | Sapphire
To register a Chat Input Command (also known as a Slash Command) with Discord, you need to acquire an application
7 Replies
I first thought I could use the options keyword inside, like this:
but this didn't work
what do you exactly need? Please elaborate
Here's an example of what I mean
I want to have such an option with my slash command
I think I need to add it in the registry. but how would I do it?
you need to build your slash commands with options
read the guide for better understanding
and for more reference look into examples
Tag suggestion for @thooooooor:
Discord bots that use @sapphire/framework v4
- Official Bot Examples α΄± α΄° α΄ΆΛ’
- Dragonite α΄± α΄°
Discord bots that use @sapphire/framework v3
- Archangel α΄± α΄°
- Arima α΄±
- Nino α΄± α΄°
- Operator ᴱ ᴬ ᴰ
- Radon ᴱ ᴬ
- Sapphire Application Commands Examples α΄±
- Spectera ᴬ
Discord bots that use @sapphire/framework v2
- Materia α΄±
- RTByte ᴱ ᴬ
- Skyra ᴬ ᴰ
- YliasDiscordBot ᴬ
α΄±: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
α΄°: Uses Docker in production
α΄ΆΛ’: Written in JavaScript. If not specified then the bot is written in TypeScript.
Solution
After many time reading through everything I found the solution:
https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands
Sapphire Framework
Registering Chat Input Commands | Sapphire
To register a Chat Input Command (also known as a Slash Command) with Discord, you need to acquire an application