NightDev Community Forums

[CustomAPI] Quote system


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.


@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!


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


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


It works by default, yes.


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?


This is how you would add the command in chat:

!commands add !delquote -ul=mod $(urlfetch$(querystring))

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


thank you sir on both questions <3


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.


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!


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:



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:
  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[$(time US/Pacific "L LT")] [$(twitch $(channel) "{{game}}")] $(querystring))

Except I replaced my token with MY_TOKEN.

Hope this helps.


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:)


@ehsankia Running into an issue where I call the list but only one quote shows up. Currently have 3 quotes in the entire list.


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


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.


Should be fixed now.


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


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?


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.