Custom "Pull from list" Command hell

Asked Apr 15, 2023·1 reply·Last activity 3 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'm wanting to create a command for when I am streaming Apex Legends.

I want to be able to type "!picklegend" or something close to that. And nightbot responds with a random character name.

I'm not sure how to code for it though. Any help would be nice, thanks!

1 reply

Hi @Modest Parrot, the command that I use to choose an option randomly is the following:

!addcom !example $(eval const responses = [ 'option A.', 'option B.']; responses[Math.floor(Math.random() * responses.length)] ; )

In the case of Apex you would have to replace the places where it says "option A and B" with the characters you want it to choose randomly. You can lengthen the options as much as you want and enter the chat.

Sorry if there is something misspelled. I am from Argentina and my English is not very good so I used google translate. I hope the command works as you wish!