NightDev Community Forums

Nightbot: Invalid or unexpected token

When ever I add a new command that pops up older commands work fine. Can’t seem to find our why

Can you please explain more as to what is going on?
Are you getting the error message when you use the older or newer command?
What are you trying to do with the new command?
Are you using the $(eval) variable?

This command
!commands add trigger $(eval var a = “$(query)”;

if (a === “phrase”) {

(“YOUR_MESSAGE”);

} else {

(" ");

})

Try this:

!addcom trigger $(eval var a=`$(query)`;a==`phrase`?`YOUR_MESSAGE`:` `)

Please note phrase is case sensitive and will only activate if typed exactly how it is In the command this means no capitals unless it’s was Phrase for instance.

That seemed to work many thanks!

That’s where you can use handy javascript functions like toLowerCase:

a.toLowerCase() == `phrase`
2 Likes

Got it thanks a bunch