Pass command using emotes?

So i was thinking of making a pass command basically where i throw a football to a $(touser) or have the option to leave it blank and pick a random user and the outcome Will be if they caught it or not using these emotes “FBPass FBCatch FBRun”
Can’t seem to get it to work

You need the possible responses to be in quotes

$(eval var a=[`Caught it FBCatch FBRun`,`Drop it FBBlock`];a[Math.floor(Math.random()*a.length)])

This should work I’m assuming that was the issue with the command

Also your missing a ` after the urlfetch

Hope this helped :hugs:

1 Like

Thank You Potato!!!

Also is there a way to show the “@” symbol when i execute the command. For example: @nightbot i tried removing the “@” from the code

a=decodeURIComponent($(querystring)).replace(/@/g,``);

Yeah just put an “@“ before the $(touser) and the first $(eval) like this:
@$(touser) and @$(eval)


Though I would assume you’d want the first one to be $(user) instead of $(touser) (So, the person using the command is the one throwing it)


Also there is a chance if left blank they can pass the ball back to them self.
I would suggest using the following link instead

https://decapi.me/twitch/random_user/$(channel)?exclude=$(user)
1 Like

Thank You Thank You !

It appears you have two extra “))” after the urlfetch. Get rid of the “)) “ after wizebot

1 Like

Question how come nightbot still shows up when i @nightbot if i exclude the bot

Because your using $(touser) instead of $(user) I’m assuming you mean it’s showing up for the first @

Try this:

!addcom !pass -cd=5 @$(user) threw the ball to FBPass @$(eval a=`$(query)`;a==`null`?`$(urlfetch https://decapi.me/twitch/random_user/$(channel)?exclude=$(user),nightbot,wizebot)`:`$(touser)`) and they $(eval var a=["Caught it FBCatch FBRun","Drop it FBBlock"];a[Math.floor(Math.random()*a.length)])

Note: I’m not sure how the random user link works if only nightbot is in the channel and you exclude nightbot it may still be able to pick nightbot
Also, if your actually @ing nightbot then it doesn’t exclude nightbot it’s only excluding nightbot if you leave it blank

1 Like

Can’t thank you enough

1 Like

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