Pass command using emotes?

Asked Aug 4, 2020·9 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.

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

9 replies

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 🤗

Thank You Potato!!!

Also is there a way to show the "@" symbol when i execute the command. For example: @member 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)

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

Question how come nightbot still shows up when i @member 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 @member nightbot then it doesn’t exclude nightbot it’s only excluding nightbot if you leave it blank

Didn't find your answer? The community is on Discord.

Ask on Discord