Why won't this command work?

When I write the following code, Nightbot does not create a command or give any response at all

!commands add hi -ul=everyone $(eval var a = "$(query)"; 
if (a === "chat?") {
("Salutations of the day, @$(user). Please allow me so see your honorable panstsu");
} else if (a === "everyone") {
("Heya, @$(user)");
} else if (a === "guys") {
("Me too, @$(user)-san?");
} else if (a === "Teo") {
("Why won't you say hi to me, @$(user)? BibleThump");
} else if (a === "teo") {
("Why won't you say hi to me, @$(user)? BibleThump");
} else if (a === "Reo") {
("B-BAKA! Don't I deserve a greeting too? What about chat, @$(user)?");
} else if (a === "reo") {
("B-BAKA! Don't I deserve a greeting too? What about chat, @$(user)?";
} else {
(" ");
})

The message is too long. Gotta find a way to shorten it for it to work.

1 Like

Here is a much condensed version, 629 chars -> 422 chars. Still might have to enter it via the dashboard.

!commands add hi -ul=everyone $(eval const a = `$(query)`.toLowerCase(); switch(a) { case "chat?": "Salutations of the day, @$(user). Please allow me so see your honorable panstsu"; break; case "everyone": "Heya, @$(user)"; break; case "guys": "Me too, @$(user)-san?"; break; case "teo": "Why won't you say hi to me, @$(user)? BibleThump"; break; case "reo":  "B-BAKA! Don't I deserve a greeting too? What about chat, @$(user)?"; break; default: " ";})
1 Like

Thank you so much, dude. I had to condense it so much that it almost eliminated the bot’s personality. I will replace it with your version.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.