Does anyone know how I would create a command that causes Nightbot to randomly pick one of the queries given, each with an equal chance of being picked—say, with five being the maximum (or at least as many that can fit in a 200-character YouTube message)?
For example, if someone were to use !choose chocolate vanilla strawberry mint cookiedough, Nightbot would randomly pick one of these queries, such as “strawberry” or “cookiedough.”
I could make such a command by making a command with a random response from a list of, say, five responses, but I’m not sure how I’d make it so that a response isn’t selected if there’s no query for it. For instance, I’d still want the command to work if someone only puts two queries.
Is there a limit to how many many items can be in the list? Also, if I make the split a comma instead, the items in the list can include spaces, correct?
Do you know if it would be possible to essentially combine the !8ball command with this !choose command and have a command that selects a random prefix from a list in a Pastebin paste followed by the randomly picked query?
For instance, if one were to use !choose PS4, XB1, Switch, Nightbot could say, “I prefer Switch,” where “I prefer” is one of the randomly selected responses from the Pastebin paste.
I tried this, among a few other syntaxes, but nothing worked, which isn’t surprising as I barely know anything about JavaScript: