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:
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
Jump to solution
7 Replies
π”π”žπ”±π”±π”¦π”«
I first thought I could use the options keyword inside, like this:
@ApplyOptions<Command.Options>({
description: 'Description',
options: ['d', 'c']
})
@ApplyOptions<Command.Options>({
description: 'Description',
options: ['d', 'c']
})
but this didn't work
Krish
Krishβ€’2y ago
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?
Krish
Krishβ€’2y ago
you need to build your slash commands with options read the guide for better understanding and for more reference look into examples
Spinel
Spinelβ€’2y ago
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
π”π”žπ”±π”±π”¦π”«
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
Want results from more Discord servers?
Add your server