Nightbot command with 3 or more possible outcomes

Asked Aug 5, 2024·1 reply·Last activity 2 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.

Hello, I was wondering how I could make a !roulette command. I know how to do the typical 2 answer way, but I want to have 3 or more answers: ex. I put !roulette in chat, and it can either respond with: black,red or green. Thanks!

1 reply

Hiya, do the odds matter, by picking just one of the 3, green will be picked 33% of the time.
Something like this would work with actual odds:
!commands add !roulette -cd=5 $(eval let spin = Math.floor(Math.random() * 36); let color = spin == 0 ? 'Green' : (Math.random() < 0.5 ? 'Red' : 'Black'); color)