Dashed arguments / flags handler? #918
-
How can we create dashed arguments / flags handler? is there any builtin func for that or any recommended library? For example, how to handle this command:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Well, Discord slash commands support options like this so I don't understand what's the problem |
Beta Was this translation helpful? Give feedback.
-
Flags come from command line interfaces and are used for optional input (which generally goes against your example here, since these seem to not be optional). There are boolean flags With slash commands, flags are completely obsolete. Instead, you would model this with a slash command named "show", with optional parameters id (number) and cat (number). For optional input, you can use |
Beta Was this translation helpful? Give feedback.
-
@almostSouji so there is no real way to have argument flags in discord.js like we had in discord.py? |
Beta Was this translation helpful? Give feedback.
-
The future of Discord applications clearly points towards slash commands as the preferred interface. Optional boolean flags are easily possible with https://discordjs.guide/creating-your-bot/creating-commands.html#registering-commands |
Beta Was this translation helpful? Give feedback.
The future of Discord applications clearly points towards slash commands as the preferred interface. Optional boolean flags are easily possible with https://discordjs.guide/creating-your-bot/creating-commands.html#registering-commands