Creating slash command with options and sapphire cli template

π”π”žπ”±π”±π”¦π”«1/15/2023
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.
π”π”žπ”±π”±π”¦π”«1/15/2023
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
KKrish1/15/2023
what do you exactly need? Please elaborate
π”π”žπ”±π”±π”¦π”«1/15/2023
Here's an example of what I mean
π”π”žπ”±π”±π”¦π”«1/15/2023
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?
KKrish1/15/2023
you need to build your slash commands with options read the guide for better understanding and for more reference look into examples
SSpinel1/15/2023
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
π”π”žπ”±π”±π”¦π”«1/15/2023
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

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
Is there any utility to check if a member has permission to run a command?Hi! I have a bot that needs to check if a member has permission to run a command and then do somethiSend and Reply from the editable-commands plugin do the same wrong thing.So I tried out both of them and none seems to respond on the interaction. what I want: image 1 whatwhat is this regex supposed to mean?What is the Best approach to developing a bot and reloading the new changes into it?I heard that logging in too many times can lead to rate limits. is there a good solution for this isHow do I create subcommands with different text input fields?Something like the image. The Docs only show how to create basic subcommands. Also in the Readme of Best Approach on separating Commands from their "run" file to a separate FolderFor context, I am super new to discordjs and this framework so apologizes if this question sounds odmessage commands are not workingtrying to update to v4 and the bot is not recognizing commands. i have enabled `loadMessageCommandLiBaseMessageOptions#components does not take BuildersHey everyone, so I've just downloaded djs 14.7.0 and i'm migrating my bot. I used to have a few `.seFailed to overwrite global application commandsSince updating to BulkOverwrite, I'm getting the following error: ``` 2023-01-12 22:00:07 - DEBUG - fetch channel returns undefinedHello. I have this code, which worked before I believe: ```js let theChannel = await client.channelmessage listeners stopped working in sapphire v4 on my bothi, this is my listener code: ```js const { Events, Listener, container } = require('@sapphire/framDuplicate identifier 'Command'I'm trying to create a basic slash command, but when I import the `Command` class from @sapphire/fraContext menu commands not being registeredHi, on updating to v4 I experienced the following error: ``` ApplicationCommandRegistry[report] FailIs there a way to disable ApplicationCommandRegistries logs?They happen on start-up and I don't want them between all of my formatted logging. Is there a way I Context Menu Interactions Not ReceivedI'm using the basic context menu command register (attached) and my run function is `async contextMeChatInputCommandError Event not firingI'm having trouble with this code https://hst.sh/odutopaniv.typescript in that the event is not firiWhat does commandError emit?I'm struggling to find what `commandError` emits when fired by sapphire.Am I doing this wrong? I feel like I'm doing this wrong.Hey there, In my ping command I'm doing `void interaction.reply(await resolveKey(interaction, "pingButton handler not triggeringHeyah @Helpers I basically added a button handler from https://www.sapphirejs.dev/docs/Guide/applicaHow to make auto idhints?so i want to make automatic idhints adding like idHints: [this.id] but i think it doesn't work so ho