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"Is there any support for phrases at a flag level?
11 Replies
@kyra 🩵🩷🤍🩷🩵 I forgot but you probably remember lexer better
Options never worked with quotes, not even the original
lexure
packageSo you're saying there is no / won't be any support for this?
That's indeed what she is saying
You should consider using slash commands where you never have to deal with quotes tbh
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)why support both tho
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.oh
the way I handle that with @Dragonite's /eval is that it pops up a text input modal tbh
flags and options are optional options
and in the modal I can put in whatever I want
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.