Highfive Command question

As someone with no knowledge of java I’m not sure if what I want to do with my command is possible.

I basically want to make it so that the command !highfive brings up the message “[sender] gives [random viewer] a high five!”, unless they specify a user in the channel, in which case I want it to say “[sender] gives [@/user] a high five!”

I’ve been message around with the script but can’t get this to work, I assume because it requires more than one variable. Any tips?

Hey @ippoteq!

Nightbot’s commands are in JavaScript, which is different than Java.

Then regarding your question, here’s the solution:

!addcom !highfive $(eval `$(query)`?t=`$(touser)`:t=`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`; `$(user) gives ${t} a high five!`)

Thank you so much for this! :smile:

1 Like

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