Is it possible for Nightbot to randomly pick one out of many choices?

Asked Jul 4, 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.

Would it be possible to create a command that contains multiple choices and have Nightbot pick one of them at random? For example,having typed the names of 10 different characters in Nightbot's website and when someone types !pick in chat,Nightbot replies with a single,randomly selected answer from the many different options.

1 reply

!addcom !pick $(eval const responses = ['player1', 'player2', 'player3', 'player4', 'player5', 'player6', 'player7', 'player8', 'player9', 'player10']; responses[Math.floor(Math.random() * responses.length)];)

Replace player# with whatever you want, command structure taken from the 8ball command.