I want !choose A B, and Nightbot returns me A or B. Thanks in advance <3
4 replies
Stellar Raccoon
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 |`)
Shaggy Buffalo
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.
Stellar Raccoon
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
Stellar Raccoon
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