Highfive Command question

Asked Jun 17, 2020·2 replies·Last activity 6 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.

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?

2 replies

Hey @Upbeat Shark!

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!`)