Multiple random items generator

I know that I can use an API or an eval to pull one random response from a list of items. Is there anyway to get it to pull multiple items from the list instead of just one?

Yes. Here is an example based on the !8ball command in the docs:

!addcom !8ball 🎱 $(eval r="All signs point to yes...|Yes!|My sources say nope.|You may rely on it.|Concentrate and ask again...|Outlook not so good...|It is decidedly so!|Better not tell you.|Very doubtful.|Yes - Definitely!|It is certain!|Most likely.|Ask again later.|No!|Outlook good.|Don't count on it.".split('|');M=Math;Array.from({length:3},_=>r[M.floor(M.random()*r.length)]).join(', '))

This code picks 3 responses and joins them with a comma and space. You can change the number of responses by editing the 3 in the command.

Share your existing command if you need help adapting it.

There ended up being too many options to pull from, so the command would’ve had too many characters. Therefore we ended up using an API. Is there a way to adapt this to use with an API? Thank you so much for the help!

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