That’s what the commands I linked are useful for, to give you a guide on how to do this.
$(eval '$(query)'?t='$(query)':t='$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))'; `$(user) gave ${t} a gift!`)
It’ll be difficult to link that to the random code you found online given you haven’t provided it to us.
There’s no need to replace the text in $(channel)
, leave it as is, it’s a Nightbot variable that automatically does the job for you. If you needed to modify anything we would have said so.
If you want more help, please give more details as to how you want the commands to work, you need to be specific.
That was a good start, and that should have been there from the start, but it’s still far from being perfect, instead of (random viewer)
you should have said (target or random viewer)
for example, to help us understand you better.