How to set up a command that is targeted OR randomized

I know I can create a command along the lines of !addcom !slap $(user) has slapped $(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel)) to target a random member of chat or !addcom !slap $(user) had slapped $(touser) to target a specific user, but is there a way to do both in one command? So if a $(touser) isnt specified it instead randomizes the target?

!addcom !slap $(user) had slapped $(eval decodeURIComponent("$(querystring)")||"$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))")

Thank you so much! That worked perfectly :slight_smile:

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