Making a command with a random chance to "ban"

Asked Aug 24, 2021·2 replies·Last activity 5 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.

Disclaimer: I know Nightbot can't timeout or ban! Also I am very bad at anything coding related so apologies if this is super basic.

My viewers are oddly interested in being timed out and often post "!banme" in chat, despite it not being a command yet. I would like to have a command that has a 1/100 chance to decide to "ban" with the remaining 99/100 outcomes being a "timeout".

Would the easiest way to do this be making a pastebin with "timeout" written 99 times and "banned" once, or is there a simpler way?

2 replies

The simplest way is this:

$(eval Math.floor(Math.random()*100)==0?`Ban`:`Timeout`)