Why isn't this command working?

Asked Dec 22, 2020·2 replies·Last activity 5 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.

Hi all,

I found this on this forum, however, I cannot get it working.
It's probably me being stupid, but I would really appreciate some help.

!addcom !pick $(eval const responses = ['player1', 'player2', 'player3']; responses[Math.floor(Math.random() * responses.length)];)

My understanding is that if I post !addcom !pick in my Twitch Channel chat, Nightbot should say either Player 1, Player 2, or Player 3.... but what I actually get is "There was an error adding the command. Error: Path message is required."

I have attached a picture of the custom command section - hopefully you can see what I am doing wrong

image.png

2 replies

Commands with spaces in the name don't actually work, and !addcom is a default command for adding custom commands, so not only does the command not work if you type '!addcom !pick', Nightbot thinks you want to add another command !pick, for which you haven't specified a command response and hence returns a message error.

You should set the name from !addcom pick to just !pick, and for future reference don't use spaces in command names or use names of default commands.

Thank you very much my friend!
That would perfectly now.

I really appreciate the help 🙂