NightDev Community Forums

[CustomAPI] Quote system


Yeah no spaces. Exact string that we had before entered into the timer.


What did the query look like?




Yeah, you can’t use variables in timers. Here, $(querystring) get’s replaced what what the person puts after the command in chat. But in timers there’s nothing. So basically just remove that.



Interesting. I removed that before and still got the same thing. :frowning: But I’m trying it again


Yeah it worked. Damn. I totally tried taking that out and it didn’t seem to work. Thanks again Ehsankia!


It’s working great for me, I’ve added it to 2 of the Channels I’m a Nightbot Editor for, I’m Just wondering if there’s a way to just have month/year without a Day for the time stamps? I don’t see it in the list of common variables

Edit: I Just realised it’s a normal Nightbot $(time) command, DOY. I found it… Still This is a great API, Keep Up the good work :smiley:


Here’s Yep you can put any valid time format string. More examples here:


Getting “no matching quote found” again. :frowning:

This time it is on my other list:

Timer Query: $(urlfetch


This seems to be working fine with the Timer Query you posted.


Figured this out. I had an alias defined in the configuration of the timer. Case solved.


When adding a quote to the bot today, I’m getting “Remote Server Returned Code 500”. But I can retrieve and delete quotes, just not add this one for some reason. !addquote Either that, or Duncy hasn’t had a chance to harden for a very very long time.

Any idea what might be causing this? Otherwise I’m really happy with this API! Thank you for developing it :smiley:


Interesting, it has to do with the game you’re playing (Pokemon) and the fact that your quote automatically includes the game name. More specific, it’s the “é” in the name. But the bug isn’t with you, it seems like nightbot $(game) is sending the game name with the wrong encoding. It seems to be latin-1 instead of utf-8?

@night can you look into that?


Aha! That makes sense for sure. Thanks for looking into it :slight_smile: Is there a way I can add it manually? I like having the game and time added to the quotes so that we have a referencepoint.


@ehsankia do you have a quick repro for the issue? encoding is already utf8


The way I have it is:

$(urlfetch$(twitch $(channel) "{{game}}"))

And my channel game is set to any Pokemon game with é in it.

And my server is receiving data=Pok%E9mon

\xe9 is a valid latin-1 character, not utf-8

Should I be wrapping the $(twitch) variable in some query variable?


Yes, you should be wrapping it in $(querystring)… so $(urlfetch$(querystring $(twitch $(channel) "{{game}}"))) should work I think


Works, though using $(channel) was giving me “unknown twitch channel”. Is there a nest limit for variable? Because this is 3 layers deep (twitch inside querystring inside fetchurl).

I hardcoded my channel name though and can confirm the unicode bug goes away.

so try that @hopsqueak, surround the $(twitch) variable with $(querystring) and you may need to replace $(channel) with your real channel name.


I’m somewhat lost at this whole thing, so could you help me modify the command I’ve got so that I can adjust it to the two version of nightbot I maintain?

This is my !addquote command:
$(urlfetch$(querystring) [$(time Australia/Lindeman “L”)] [$(twitch $(channel) “{{game}}”)])


$(urlfetch$(querystring) [$(time Australia/Lindeman "L")] [$(querystring $(twitch $(channel) "{{game}}"))])

if that fails replace $(channel) with your actual username.