NightDev Community Forums

[CustomAPI] Quote system


#61

I don’t think it’s possible with the current technology, and also, this could be annoying if someone suggests another quote by the time you go to type accept. You can still have some sort of suggestion, and then admin would have to manually type "!addquote " which is a bit annoying but yeah, sadly it’s the best that can be done right now.

If you really really insist, it wouldn’t be too hard to have a pair of custom api, one that just takes an input, and another API that gives you back the last item submitted to the API. I could see this being useful in other places I guess.


#62

@ehsankia if I am using your quote system to generate highlights like @Aaron128l explained on another thread and I wanted it to also generate the stream title into the thread how would I go about doing this? Also if it matters I’m using it to generate highlights for friends stream I am mod in not my own. Thanks in advance!


#63

If your using my example with

!commands add !addhighlight -ul=moderator -a=__highlightadd [$(time America/Denver “MMMM d | hh:mm a”)] [ $(query) ]

Then just add $(twitch $channel "{{title}}") anywhere after a=__highlightadd


#64

So !quote list just works? Or how do I set that up


#65

It works by default, yes.


#66

Trying to make !delquote moderator only

Where do i have to add -ul=moderator to do so? Where I have it currently is giving me invalid output from nightbot

(if you could show in the full string) <3

is -ul=moderator even correct in this? or am I to use $(userlevel) and if so where should that go then?


#67

This is how you would add the command in chat:

!commands add !delquote -ul=mod $(urlfetch http://twitch.center/customapi/delquote?token=TOKEN&data=$(querystring))

All modifiers -ul= -a= -c= go after the command name (!delquote in this case) you can read about that here: https://docs.nightbot.tv/commands/commands at the bottom


#68

thank you sir on both questions <3


#69

If you do the automatic at the top, it should take care of that for you (although only the channel owner can do it).

Also, you can use the nightbot control panel site to do it, which provides you with an interface which makes it easy to set these kind of extra options. You can also edit old commands to make them moderator only.


#70

I plan to use the Quotes for stupid things I say on stream. I added the time a quote was entered by adding:

&data=On $(time America/Denver) name said: $(querystring)) to the !addquote command.

It produced the following when I typed !quote: 2. On September 29th 2016, 4:54:47 pm MDT GMT-06:00 Greyhart said: Testing, testing…1, 2, 3!

I thought I’d put it here in case someone wants to do something similar. You can play around with formats, if you don’t want the entire date/time.

P.S. Thanks for the commands! They work great!


#71

Could you tell me how to modify the !addquote command to add a timestamp and the game that was played? I’ve been trying to work it out myself, but not had much luck so far ^^
Really appreciate this API, it’s brilliant :slight_smile:


#72

@hopsqueak

Sure, here’s a few things you need to pick first:

  1. What timezone do you want the time in. In my example, I’ll use US/Pacific. Here’s a full list:
    https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  2. How do you want that datetime to look. Here’s a short table for common formats:

    There’s more advanced one, but I’ll pick “L” for the date and “LT” for the time.
  3. How you want it to all look. For my example, I’ll go “[TIME] [GAME] quote”

Here’s what the data segment looks like
&data=[$(time US/Pacific "L LT")] [$(twitch $(channel) "{{game}}")] $(querystring)

It’s a bit complicated, but all you need to change here is US/Pacific, and maybe the “L LT” if you want a different format. You can also try changing the [ ] and the order but be careful.

Then, the FULL thing looks like this:
$(urlfetch http://twitch.center/customapi/addquote?token=MY_TOKEN&data=[$(time US/Pacific "L LT")] [$(twitch $(channel) "{{game}}")] $(querystring))

Except I replaced my token with MY_TOKEN.

Hope this helps.


#73

Thank you! I was just struggling to determine how to add the time part and couldn’t fine the game command. Really appreciate the time you took to put this in:)


#74

@ehsankia Running into an issue where I call the list but only one quote shows up. Currently have 3 quotes in the entire list. http://twitch.center/customapi/quote/list?token=8df3f178


#75

I only see one quote right now, unless you removed that.

If you call “!quote” it give one randomly. If you put “!quote 1” or “!quote 2” it’ll give that quote


#76

Yeah that is the issue. Only one quote shows up in the list but I actually have 3 entered in. See below:

CremasterContusion - Today at 12:35 AM
!swquote 1
NightbotBOT - Today at 12:35 AM
Exanimus is a death cult obsessed with become undead. They have taken a technological approach in using cyberware to keep the body just barely alive.
CremasterContusion - Today at 12:35 AM
!swquote 2
NightbotBOT - Today at 12:35 AM
The Trade Federation is a sovereign, neutral agency that protects the FTL lanes from piracy and ensures fair trade. Similarly, they are the galactic equivalent of a police force.
CremasterContusion - Today at 12:35 AM
!swquote 3
NightbotBOT - Today at 12:35 AM
Ron Schlotskie, Residential Badass. *Puts on purple slotted shades and motors away.


#77

Should be fixed now.


#78

Do your magical coding abilities know no bounds?!? What a time to be alive! :cold_sweat:


#79

Hey @ehsankia,

One more issue with nightbot. When using the call in nightbot’s timer it returns Nightbot : No matching quote found

But if I run the command manually with the same call it behaves as expected. Any idea what the difference could be?


#80

Are you sure you made the timer properly, and there isn’t an extra space at the end. Honestly I should probably strip extra spaces, that might fix your issue.