create a command that has spaces as one arg
for example, i would want a command with multiple spaces for each arg, such as
!command <argwithspaces1> <argwithspaces2>
, or even using seperators like |
i just dont know where to start or if its even possible at all ( i tried using args.repeat and args.nextMaybe but that didnt work at all )10 Replies
u can do that with qoutes
!command "this is the first arg" "this is the second arg"
docs: https://sapphirejs.dev/docs/Documentation/api-framework/interfaces/CommandOptions#quotes
otherwise its impossible to know when an arg ends
and you can make ur own args in sapphire
https://sapphirejs.dev/docs/Guide/arguments/creating-your-own-arguments
Sapphire Framework
Creating your own arguments | Sapphire
Creating an argument can be done by extending the Argument class which can be imported from the framework:
or just use slash commands because string options natively support spaces 👀
This is the best option, but doesn't work for every case.
For example, you can't use newlines or any formatting characters in it. One of my main use cases (and the quotes work totally fine for this) is that you can create a message embed.
You cannot get that from the slash command - it would be returned as
To format the description, I often find myself running message commands that look like this
I'm pretty sure you can use \n for newlines
Nope - does not work.
formatting *does* work
- I thought I'd had issues with that in the past
(In the context of my command, you wouldn't be formatting without newlines.:DentGeHmm:
The only way I know of without using modal commands for actual new line support is to use a modal
I had this solved, your code receives
\\n
instead of \n
.
So you need some preprocessing before sending out the embed
I don't remember the syntax, but its something like this:
or this: