Introduction
This custom api adds Quote functionality for your channel through nightbot.
It allows you to add quotes, and have users request random or specific quotes.
Warning: This is meant to be a system for adding quotes in Twitch chat, and not an arbitrary database. There is no guarantees for uptime or data retention. I reserve the right to limit and boot off any abusive use of this API at anytime. If you want a database, please host your own custom API.
Automatic Installation
For this method, you need to be the owner of the channel.
Also, make sure you don’t already have any custom commands named
!quote, !addquote or !delquote, as they will be overwritten.
All you have to do is visit this webpage, and sign in with Nightbot.
It will automatically add those 3 commands to your channel
https://twitch.center/customapi/quote/nightbot
Manual Installation
This method is for those who are very familiar with creating and editing complex commands.
If you’re a mod of another channel, if you want to customize the commands, or use another bot,
you can manually add the 3 commands yourself. Be careful though, if you do it through chat
and someone sees your secret token, they will be able to modify your quotes.
Simply go here to generate the 3 commands: https://twitch.center/customapi/quote/generate
Make sure you set the userlevel for addquote
and delquote
to moderator only.
EDIT: You can now add &no_id=1
to the url to disable numbering on quotes.
EDIT2: You can now delete ALL quotes by adding &clear=1
to !delquote
command.
EDIT3: You can now silence non-error responses (“Quote added successfully”) with &silent=1
Usage
Get a quote
This one is usable by anyone, and there are 3 different ways to use it.
!quote
This will return a random quote
!quote 4
This will return the 4th quote in the list
You can use negative numbers (-1 would be the last quote)
!quote cookie
This will return a random quote containing the word “cookie”
There’s also a special command:
!quote list
This returns a webpage with all the quotes in a list
Add a quote
To add a new quote, you simply pass it to the !addquote
command:
!addquote This is a new quote!
Remove a quote
There are two ways to remove a quote. Each quote when printed has an id, so you can use that:
This will delete quote #5
!delquote 5
Or, you can specify a substring of the quote, it will only delete it if there’s only one match
!delquote new quote
Editing a quote
This hasn’t been fully tested yet, and it’s not automatically added as part of the “Automatic install”, but you can manually add a “!editquote” command pointing to http://twitch.center/customapi/editquote
using the private key. The syntax is:
!editquote [id] [new quote]
So for example:
!editquote 5 new quote replacing quote #5
Common issues
I accidentally got rid of my !quote command
If you still have access to the private token (used for !addquote/!delquote), you can recover using:
https://twitch.center/customapi/quote/recover?token=<private_token>
Unicode characters don’t work
Nightbot handles special characters fine, you may not have installed the commands properly. If you’re using another bot, you need to lookup documentation for that bot and contact them, as they behave differently. For example, on StreamElements bot, you need to use $(queryencode $(1:|' '))
instead of ${querystring}
.
I’m getting 500 error
There may be something wrong with either Nightbot or my servers. Wait a bit for transient issues; if it persists, feel free to DM me on Twitter.
Suggestion / bugs
This is fresh out of the oven and hasn’t been thoroughly tested yet.
If you run into any strange behaviors, feel free to make a post here.
Similarly, if you have any suggestion for extra functionality, feel free to leave a comment.