Need help with a basic command

I am a mod for a small streamer that plays a lot of Minecraft. I’d like help setting up a command where viewers can do something such as !party [their IGN] and they are added to a list that I can look at with another command such as !plist. I also would need commands to remove IGNs. Thanks, and if you can make it so only followers can run the !party command, that’d be great.

Thanks again!

I also would like to say I’m not the best with nightbot so if you can write the commands for me that’d be awesome. :slight_smile:

Before you use these commands, go to https://twitch.center/customapi/quote/generate and generate your own tokens (there are two different tokens, one for !party and !pclear and one for !plist).

!party

$(eval if (`$(urlfetch https://2g.be/twitch/following.php?user=$(user)&channel=$(channel))`.includes("has been following") || `$(user)`.toUpperCase() === `$(channel)`.toUpperCase()){if (`$(urlfetch http://twitch.center/customapi/addquote?token=1d78cd0d875572bd&data=$(querystring))`.includes("Successfully added entry")){`@$(user) your IGN was added to the list`} else {`@$(user) please enter your IGN after !party`}} else {`@$(user) please follow $(channel) before adding your name to the list!`})

!plist (add &no_id=1 to the end if you don’t want the numbers)

http://twitch.center/customapi/quote/list?token=d8458e45

!pclear (make the userlevel Moderator)

$(urlfetch http://twitch.center/customapi/delquote?token=1d78cd0d875572bd&clear=1)

Actually, that code for !party will still add their names to the list even if they aren’t following, because Nightbot will still visit the URL for adding the quote, regardless of what happens in the eval. You’ll have to split !party into two commands if you want it to work like that.

!party (alias to !partyadder)

$(eval if (`$(urlfetch https://2g.be/twitch/following.php?user=$(user)&channel=$(channel))`.includes("has been following") || `$(user)`.toUpperCase() === `$(channel)`.toUpperCase()){`=$(querystring)`} else {"="})

!partyadder (userlevel Moderator)

$(eval if (`$(urlfetch http://twitch.center/customapi/addquote?token=1d78cd0d875572bd&data$(query))`.includes("Successfully added entry")){`@$(user) your IGN was added to the list`}else{`@$(user) make sure you're following $(channel) and entered your IGN after !party`})

Im having problem with the p list command. Could you write it for me? It’s just not working. I’m really sorry I’m kind of a noob.

All I need is the 3 commands exactly written so I can paste them into chat. Just put like (token) where I put the tokens. Thanks!! :slight_smile:

Go to https://twitch.center/customapi/quote/generate. You will see three lines. After token= on the first line you will see your first token. After token= on the second and third lines you will see your second token. You should replace FIRSTTOKEN and SECONDTOKEN before you add these commands.

!commands add !party -a=!partyadder $(eval if ((`$(urlfetch https://2g.be/twitch/following.php?user=$(user)&channel=$(channel))`.includes("has been following") || `$(user)`.toUpperCase() === `$(channel)`.toUpperCase()) && `$(query)`){"=" + encodeURIComponent(`$(query)` + ", ")} else {"="})

!commands add !partyadder -ul=moderator $(eval if (`$(urlfetch http://twitch.center/customapi/addquote?token=SECONDTOKEN&data$(query))`.includes("Successfully added entry")){`@$(user) your IGN was added to the list`}else{`@$(user) make sure you're following $(channel) and entered your IGN after !party`})

!commands add !plist $(eval list = `$(urlfetch http://twitch.center/customapi/quote/list?token=FIRSTTOKEN&no_id=1)`; if (list === "There are no quotes added"){"No IGNs have been added"} else{list.substr(0, list.length - 2)})

!commands add !pclear -ul=moderator $(eval `$(urlfetch http://twitch.center/customapi/delquote?token=SECONDTOKEN&clear=1)`; "All IGNs have been removed")

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