string option, support for strings inside quotes?

Feel a bit silly making a thread out of this as it's a question rather than a support topic I have read that using args.pick("string") will match the next singular word, or the phrase contained "within quotes". I gather that options and flags are generally used for numerical or bool like inputs, but when reading the value of a flag, it does not behave the same way. ie
^test "Hello World" --flag="This is a test"
const input = await args.pick("string"); //Hello World
const flag = args.getOption("flag"); //"This
const input = await args.pick("string"); //Hello World
const flag = args.getOption("flag"); //"This
Is there any support for phrases at a flag level?
11 Replies
Favna
Favna2y ago
@kyra 🩵🩷🤍🩷🩵 I forgot but you probably remember lexer better
kyra
kyra2y ago
Options never worked with quotes, not even the original lexure package
Bejasc
BejascOP2y ago
So you're saying there is no / won't be any support for this?
Favna
Favna2y ago
That's indeed what she is saying You should consider using slash commands where you never have to deal with quotes tbh
Bejasc
BejascOP2y ago
I am using slash commands - but I intend to support both Have this working from a slash command perspective obv. What doesn't work from a slash command (and is particularly useful in the context of this command) is the ability to _format any text_ **like this**, etc (or even add newlines) (use case is creating an embed, or another use case of speaking, as a user would, but via a webhook)
Favna
Favna2y ago
why support both tho meguFace
Bejasc
BejascOP2y ago
did you read the above message? 😛 I can work around this by - if a flag opens with " - reject it and offer an ephemeral reply to use and underscore in place of spaces - replace underscore in the flag with spaces, after processing Just a little frustrating that you guys don't offer support for this, and have it inconsistent with the behavior of args.pick. I understand that lexure is not yours, but it's still frustrating all the same.
Favna
Favna2y ago
oh the way I handle that with @Dragonite's /eval is that it pops up a text input modal tbh
Favna
Favna2y ago
flags and options are optional options
No description
Favna
Favna2y ago
and in the modal I can put in whatever I want
No description
Bejasc
BejascOP2y ago
Yeah, I've thought about using a modal for it. It's a good solution to the no formatting in slash command problem, but I'd still prefer to support both. The project I'm working on is coming from a fairly large/established RPG community, who are very used to prefix based commands (and apprehensive of slash commands). Being a text based RPG, there's some level of charm in hanging on to old but gold 😄 This is part of the reason I have for supporting both, though I've found slash commands to be a lot easier to work with.

Did you find this page helpful?