You can see what !aka is passing to _aka by decoupling them (edit !aka on the dashboard and clear the Alias field) and testing various inputs. This is what !aka is passing to _aka:
[1] [2]
If the last argument is an integer, [1] is the last argument, else [1] is the ‘#’ character.
If the last argument is an integer, [2] is the user input excluding the last argument, else [2] is the entire user input.
This response for _aka should have better error handling. Remember to use the dashboard instead of chat:
Is there a way to edit the whole quote list more easily? We are at 1000 quotes now and would like to remove some.
The !delquote command gets the quote numbers all changed up (e.g. quote 600 is then quote 599).
The !editquote command is very handy for single quotes, but doing that for all quotes would be tedious.
Is there for example a txt, csv or any file where all the quotes are saved in that you can change from outside, without needing to use the nightbot commands?
Having the same problem as @sttarrgazzerr atm - deleted my commands with the private token but still have access to the public one. Is there any type of reverse version of the tool below?
I’m trying to implement the !editquote command for a streamer but I don’t understand what the “private key” is or how you get an !editquote command leading to a website to edit the quote. I’m new to this but have had no roadblocks with adding commands to nightbot until this one. Could anyone specify?
The token is a unique string of letters and numbers that only the streamer should know. The token is written in the add/delquote command lines when you first generated the command lines like it says in the original post.
I apologize for being dumb, I’ve tried multiple times to get it to work but I’ve had no luck. How exactly should it be typed out? I’ve tried it as what you said but it just said error.
Replace PRIVATE_KEY with the private key to your quote list. This should be the 16-character long random string of letters and numbers that allows Nightbot to add/edit/delete quotes. You should already have this key handy if you already have a quote list set up. If you did not set up the quote list yourself, ask the streamer who you moderate for to private message it to you.
Just in case, this is the usage for !editquote:
!editquote [list ID number of the quote] [new quote]
If your Streamlabs Chatbot is reading off lines from a locally stored file, there is no good way to import your quotes to this quote system other than running the !addquote command for each and every line.
You may be better off storing your quotes as a Pastebin file.
Look at this pastebin file I use for a trivia command. Note the following aspects of the file:
The file starts and ends with square brackets []
Each trivia fact is bounded by backticks ``
The facts are separated by commas.
Go to https://pastebin.com and create a file for a new !quote command that follows the same aspects as detailed above. Once you create it, copy and paste the following command setup into your Nightbot dashboard to create the command. Replace RAW_PASTE_LINK with the raw paste link to your pastebin file (the link looks a bit like https://pastebin.com/raw/fooObarR):
The public token is 8 characters long and the private token is 16 characters long. The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring) Copy these tokens down and keep them somewhere safe.
If you’re familiar with cURL you could write a php script that loops through a list of quotes and makes a GET request to the quote API for each quote.
Example given below:
<?php
// Set up an array of quotes to be added to the quote list
$quotes = ["Hello world!","Sh-boom sh-boom! Oh life could be a dream!","Who toucha my spaghett?!"];
// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$url = "https://twitch.center/customapi/addquote";
// Loop through the quotes array and add each one to the quote list via cURL
for($i=0; $i<count($quotes); $i++){
$params = array("token" => "PRIVATE_TOKEN", "data" => $quotes[$i]);
curl_setopt($ch, CURLOPT_URL, $url . "?" . http_build_query($params));
curl_exec($ch);
}
// Job's done!
curl_close($ch);
echo "Job's done!";
?>
Hey! I mod a Twitch chat and I think one of the other mods manually deleted the !quote command and now we can add and delete quotes but the !quote commands (i.e. !quote 1, !quote 2 etc) do not work… any ideas on how to fix this?