[CustomAPI] Quote system

Thank you very much for the help! I had to add my actual username, but then it works perfectly.

I really appreciate the support and help given here, by all three of you. Thanks again :slight_smile:

@Aaron128l @ehsankia if I want it to call on it in chat as a Highlight instead of saying Quote added how would I go about doing this?

Is the issue only the reply, saying Quote added instead of Highlight added? Unfortunately that’s on my end and I can’t really change it without making this API much more complicated

yeah that was the only thing. was just wanting it to be a bit more uniformed and look a little cleaner in chat. I figured it was probably something I wouldnt be able to do but figured I would ask anyways. thanks for the speedy response!

Hi!
is there any chance tu use the list on OBS BROWSER?
with autoupdate?

Just wondering how one could modify this into a !kills list instead?
It’s for a DayZ streamer and while it’s easy to just implement the quotes system with a different command name it’ll still return “Successfully added quote #”, which I’d also like to get rid off.
But, the main issue is that I’d like to make it work like this: A mod updates the command with !addkill and a clip link, the old kill that was there gets moved onto the list that’s fetchable with !kills and the new one (so not a random one) gets fetched by !kills.
So basically, I want the word ‘quote’ replaced with ‘kill’, and I need it to always fetch the newest kill off the list, because there’s also a !lastkill command into play that has to do that. I’m stuck with that, pretty much. I thought about using the ´$(count)´ variable but I don’t think it’s possible to tie the ´$(count)´ from another command into that ´!lastkill´ one.

Thanks in advance!

I’ve got an idea for your !lastkill command:

Have another bot with a count variable (ie. Ankhbot) join the channel and make sure the streamer has added it as a moderator.

Assuming you’re familiar with Ankhbot custom commands, you can set up a command on Ankhbot called !addkill such that after Nightbot has added an entry to the kills list, Ankhbot will respond with “!editcom !lastkill (whatever text you want here) $(urlfetch http://twitch.center/customapi/quote?token=(YOUR_QUOTE_TOKEN)&data=(ANKHBOT_COUNT_VARIABLE))”

What this essentially does is change the entry ID search in the !lastkill quote API every time someone uses !addkill

Make sure to make the Ankhbot !addkill command moderator-only.

This may not work if Nightbot can’t react fast enough to different commands in such a short time.

Let me know how it turns out! :slight_smile:

functionality was already added so that two bots aren’t needed to a grab the entry in the list.

Now if you simply call !quote -1 the last added entry is shown. Instead of worrying about two bots keeping counts and any nonsense like that

1 Like

Thanks for the tip! Didn’t know you could input -1 for the most recent entry.

So I guess the syntax for @robert_jan 's !lastkill command could just have -1 in the data parameter for the quote API then.

1 Like

Correct. That feature was added because of his request.

1 Like

And to be more specific, you can keep going further negative to get the 2nd last result and so on. I’ll add it to the documentation at the top.

2 Likes

Can I do like an automated list thing that when somebody says !jq he will automatically get to the list which only moderators can see by typing !list?

Example: A guy named Josh comes to my stream and says: “Hey, are you doing art for people?” Then he types !jq and my bot says: “You have been added to the queue in position #?”. Then I can see who is next in the queue by typing !list or something.

My mods are now taking care of the list by just editing the !list command manually which is really, you know, not the best way.

if you make !list a command that does !commands add !list -a=!quote 1 replacing !quote with whatever you set your original quote command to be, it will list the first person in the list.

You could then similarly make a delete command that pops the first person off the list: !commands add !pop -a=!delquote 1 replacing pop with whatever you want to call it and delquote with whatever the command is for deleting individual quotes. Doing this automatically re-sizes the list, so number 2 becomes number 1, etc etc. So !list will work fine after deleting.

@Slikrick Now I got everything working except when you type !list it only shows the first person on the list. And when I do !editcom !list -a=!quote list it says the website where you can see the full list. But can you make the command !list so it shows the full list without going to the website?

No, because the list can be any size and there is no formatting supported. The services only allow a certain amount of characters in a single message and i believe in nightbot restricts customapi’s to returning 400 characters. The link to the website is the easiest way to give the most information to those who need it.

Ok. Thanks anyway :slight_smile:

I was able to modify the commands to use this as a list for listing things. How would I go about modifying it, if I wanted to add something to the top of the list and have everything move down. For example,

  1. John
  2. Steve
  3. Frank

I want to know add Jason to the list but he gets to be #1.

That isn’t really possible with the quote api. Things are added in chronological order and the order only changes when something gets deleted (everything below the deleted thing moves upwards).

Why do you want/need to do so?

I am using the “queue” system as a list for participation in our groups. So people sign up and we had them to the list. Certain activities, like donations, winning a raffle, etc. would get a person to be #1 on the list. I was unable to find any other custom APIs for lists and do not know how to do it myself and this was the best way I was able to find.

Hi, I can add quotes to my private token, but when I try a !quote it says no quotes added, I tried to see my quotes replacing the token on !quote list, it also says no quotes added…
I can add and remove quotes with add/del commands…