[CustomAPI] Quote system

But actually i want to run a if statement like this

$(eval decodeURIComponent(“$(querystring $(2))”).toLowerCase==“ID”?$(urlfetch http://twitch.center/customapi/addquote?token=TOKEN&data=$(querystring)).slice() +“You are right”:“$(user) Fail!”)

If user say ID in second string, hide alert and show you are right, if not, show fail.

Add a random quote function?

If you don’t add a number a random quote is shown.

alright i tried learning this on my own but have had no success. the custom api for recent followers will not work for me keeps popping up saying " The most recent followers are No channel"

@ehsankia I’ve noticed that the negative index causes the last added quote to be listed as either “-1”, “0” or the listed number (example 259). Additionally, if we call “!quote” and a string/word and a quote is not found, it only pulls the last quote. Is it possible to either respond with a random quote or “no quote found”?

Example: “!quote curse” is used, however, no quote is found using the word “curse” so it pulls the last quote added.

Is there any way nightbot does not need to send me an answer?

@coffeman0 You can use $(eval) to make Nightbot send a request to the API but also not output its response like so:

$(eval a='$(urlfetch http://twitch.center/customapi/addquote?token=yourPrivateTokenHere&data=dataInput)';' ')

Creating the variable a will call the $(urlfetch) variable within the $(eval), using the API. Then it’ll make Nightbot output a space, which will then make the message blank.

I am using the quote system for my game requests so people do !gamerequest (name of game) and it adds it to the list. My issue is the ! command is not seen to my viewers so i was wondering if there was a way for it to respond with what they added.
Nightbot currently says this: Successfully added entry #4
However it would be cool if it said this: Successfully added entry #4 - Zelda

or whatever. or even a line after that simply said the game name. any thoughts or Ideas… thank you all

@Durendx The response for the command can be:

$(urlfetch http://twitch.center/customapi/addquote?token=...) - $(query)

Nightbot would say “Successfully added entry #X” then say what was added in the $(query) after that.

@ehsankia, do you know if the !delquote and !editquote commands are not working at the moment? I just found this thread and added to my channel but those 2 commands are not functioning right.

I have added 4 quotes just fine and they show when I !quote 1 or 3 but when I do !delquote 3 or 1, it says “no matching entry found”

Are you able to help?

I don’t know if this is still being responded to but how do you make nightbot say “quote #3” instead of just “3.”? Also when I try to say !quote #3 instead of !quote 3 it doesn’t recognize that either. It seems to not recognize the # at all. I’m not great with programming so any help would be appreciated

@andywall In your command response just do something like:

Quote #$(urlfetch http://twitch.center/customapi/...)

Thank you for a quick response! I’m a little confused though, there the “…” is, would that be where I put the # for it to show #3 instead of just 3.?

You can use Nightbot’s eval variable to strip the # character from the query.

Quote #$(urlfetch http://twitch.center/customapi/quote?token=YOURPUBLICTOKEN&data$(eval "="+encodeURIComponent(decodeURIComponent("$(querystring)").replace(/#/g,""))))

Replace YOURPUBLICTOKEN with the token in your existing !quote command, which you can find here: https://beta.nightbot.tv/commands/custom

@andywall No. The ... part is just for the rest of the quote custom API link. What this does:

Quote #$(urlfetch http://twitch.center/customapi/...)

It will automatically put a “Quote #” in front of the quote when you use the !quote command.

Oh! ok, thanks so much, my streamer will thank you greatly :smiley:

There is an issue related to your property to connect with opera support that solves all the problem and give you clear access to all the things that you need.

Hi thanks for making this. I am moderating a few Twitch Channels and I have added your quote API to add all the clip commands created for a specific channel to pull a random clip so viewers can have fun without needing to remember all the commands. The commands are listed correctly on the Token and Nighbot pulls the randomclip command correctly so it comes back for example a quote like !rage1 . The issue is I want that quote to actually execute the command into Nighbot now it just pulls it as text without executing the command a user needs to input into the chat the actual !rage1 command to work. This is what I use in the Nightbot command. Can you recommend what needs to be changed to make this work or is it not possible?

$(urlfetch http://twitch.center/customapi/quote?token=80550788&data=$(querystring)&no_id=1)

hey, is there a way to export the quotelist to google spreadshet?

i Have a List running and i would like to know if there is way to make a command like !Upnext===1 on the list … So Nightbot will post in chat something like Upnext is #1 Name ,is that possible