Random viewer or targeted viewer command

Asked Feb 10, 2022·2 replies·Last activity 4 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.

Hi learned friends! Wondering if any of you can help with this. I'm trying to create a command which allows me to target either (1) random viewers in the Twitch chat when I just type the command, or (2) a selected viewer when I @ them.

So for example:

  • if I type "!snipe" it would return: "Oi, [random viewer's name], mate! Are you stream sniping right now?! Reveal yourself!"
  • if I type "!snipe @member" it would return: "Oi, Frank, mate! Are you stream sniping right now?! Reveal yourself!"

I know how to make a command using $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel)) to pull a random user from chat and I know how to make a command using $(touser) to target specific users, but I have no idea how to make a combination command.

Help please! Thanks in advance!

2 replies

Hi Emily! Thanks so much for pointing me to the answer. My apologies as well for starting a new topic on this already answered question. Thanks again though and much appreciated.