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

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

1 Like
$(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 |`)
1 Like

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

1 Like

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

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.