Variable nightbot in answering?

Is it possible to make nightbot say different answers for same command to make him more interactive?

For example:

command is when

when should i get…
nightbot: tomorrow

when again?
nightbot: now… before u forget

sounds stupid, i know but would be epic if i could use nightbot like that

Is it possible to load nightbot inside visual studios and change the command itself with math.random to let him roll the answer itself?

You could use the $(eval) variable:

!addcom when $(eval 
var a = ["Tomorrow", "Now... Before you forget", "ANY_OTHER_ANSWERS"];
var b = a[Math.floor(Math.random() * a.length)];
var q = "$(query)";
if (q === "") {
(" ");
} else {
(b);})

It’s probably a bit sloppy, but I think this is more or less what you were looking for. In my version the bot will give no reply if someone only says “when” with nothing after it, however you can change that if you wish. Also obviously replace ANY_OTHER_ANSWERS with any other possible responses you’d like the bot to give, following the same format as the previous ones.

Dude, u are a god

Thank you so much :smiley:

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