How to a command choose A or B? [help me]

Asked Sep 10, 2023·4 replies·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.

I want !choose A B, and Nightbot returns me A or B.
Thanks in advance <3

4 replies

js
$(eval a=`$(query)`;b=a=>{a=a.split(`|`);return a[Math.floor(Math.random()*a.length)]};a.includes(`|`)?b(a):`Please enter any number of options separated by a |`)

Thanks.
But I don't just want to choose number.
I want to choose food,drinks,anythings.
!choose eat sleep
Nightbot will reply eat or sleep.

this does exactly that... but can be more than 2 items, also each item can be more than one word just have to put a | in between
to make a | hold shift and hit the wider button between enter and backspace

for your example, it would be...
!choose eat | sleep

or u could do...
!choose eat | sleep | make banana creme pie | go to grandma's house | kiss the bus driver

and it would pick one of those for u