Nightbot 8Ball fixed response

Asked Mar 15, 2020·1 reply·Last activity 6 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.

Hey I was wondering if it was possible to set up a Nightbot command where if anyone asks !8ball a question, it responds usually with the traditional random answers. But if a specific viewer in my chat asks Nightbot/8ball, Nightbot would respond with a fixed answer I gave it.

1 reply

Hey @Pale Hippo!

Yes, do it like this:

$(eval u=`$(user)`; r=[`RANDOM_ANSWER_#1`,`RANDOM_ANSWER_#2`, ... ,`RANDOM_ANSWER_#n`]; u==`SPECIFIC_VIEWER`?`FIXED_ANSWER`:`${r[Math.floor(Math.random()*r.length)]}`;)

Just replace the RANDOM_ANSWER, SPECIFIC_VIEWER, and FIXED_ANSWER fields.