NightDev Community Forums

Command that chooses a random person in chat

Hey, I’ve seen some streamers that have commands that will randomly select a person in chat and wanted to know how i might do it?

i.e.
!throw

Nightbot: “(Person who did the command) threw a ball at (Random person in chat)!”

How would be the best way to go about this?

Thank you!

Hey @CentenialPariah!

Assuming you stream on Twitch, here’s a solution:

$(user) threw a ball at $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))!
1 Like

Is possible the command select nighbot as well?

Yes, is that an issue?

If you want to filter out Nightbot or $(user) from the command, have a look at this: