How 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 the subcommand plugin it is not mentioned
Solution:Jump to solution
if yes, https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands is the correct place.
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
25 Replies
I implemented it to this point, but now the chatinputs are not there
you still have to register the application commands by following the application registry guide
good to know, this is not shown in the readme of the plugin...
wait is a chatinput command this?
Solution
if yes, https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands is the correct place.
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
Is the only way to create those command registery via the builder?
That is a chat input command yes
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
or well
the command is
birthday
the subcommand is register
and day
is an optionand you can refer to the DJS guide to learn more about commands, as well as above linked Discord docs https://discordjs.guide/creating-your-bot/slash-commands.html
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
you can provide a regular object as well but. especially for someone like you whose new to this I very strongly recommend using the builder because you're not yet familiar with all the syntax. Using a builder will also give you runtime code validation.
do you have resources where I can find out more about working with regular objects? Im migrating my bot from the old plattform i was using (Autocode) and have the objects for the commands already. Just out of curiosity
mine look like this
that exactly
specifically
ohh hats easy
id prefer it like this then
you do you but I personally never liked the vagueness of
type
. It's a magic number. It doesn't what type it is at all.i see what you mean
You either have to remember what type is what, or constantly reference it
whereas with builders you have things like
addStringOption
a more unrelated question, cant I use this.description to reference the description I wrote in the ApplyOptions?
no
So I need to write the description twice in the file
also you shouldnt have a constructor and @ApplyOptions
I read it as "can I use" not "cant I use" lol
look at some examples tbh
__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.
broken markdown syntax yay
yeah I just fixed it
RIP my PR to sapphiredev/sapphire-slashies