Variable for "Command Name Used"?

Asked Dec 12, 2023·5 replies·Last activity 2 years 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.

Heya all 🙂

Is there a way to get the command name that was used, as a variable ?

A friend has an API that has 2 input variables and wants to return a "Correct Usage" message if parameters do not make sense for instance. The thing is that the command name people might use on their own stream is variable.

l.e. If someone has the command set as being !getstats, the API would reply with:
Please try again - Correct usage is "!getstats [username] [servername]"

I know it could be done manually with the url e.g.

?command=%21getstats

but that is messy.
It would be much neater to be able to do something like:

?command=$(commandused)

Many thanks,

Zoe

5 replies

EDIT: Changed the OP to explain better

This would be a useful addition, I would like this to. @night would that be possible?

You can now use the variable $(command) to get the current command being executed.

If you need to reconstruct the full message, you can also do so with $(command) $(query).

Neat :star_struck: Thanks so much :)

Didn't find your answer? The community is on Discord.

Ask on Discord