Custom commands and multi-word arguments

Asked Aug 31, 2024·3 replies·Last activity 1 year ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hi

I am trying to make a command that will react to parameter (which i can do) but where the parameter is a multi word value like a name "Slarty Bartfast" "Slarty" and "Bartfast" are split on the space, despite me enclosing them in double-quotes. Is there a way to retain the 2 words as a single string?

thanks

3 replies

You can leverage $(query) to get a user's arguments as a string

By this do you mean the $(1) syntax?

Searching NighBot docs for $(query) yeilds no results.

If $(1) is what you mean, I am already using this and encountering a lack of ability to pass multiple words as a single parameter value even when enclosed in double or single quotes
eg:
!myCommand "Slarty barfast"

gives:
$(1) = Slarty
$(2) = Bartfast

my need is to have $(1) = "Slarty Bartfast"