NightDev Community Forums

[CustomAPI] Quote system


#353

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:

$(eval d=decodeURIComponent;if(d(`$(2)`)!=`null`){a=d(`$(querystring)`).split(` `);a.shift();b=`$(urlfetch https://twitch.center/customapi/quote?token=********&no_id=1&data=$(1))`;b=b==`No matching entry found`?`$(urlfetch https://twitch.center/customapi/quote?token=********&no_id=1)`:b;b=b.replace(/[“”"]/g,``);c=b.lastIndexOf(` -`);b=c>-1?b.slice(0,c):b;if(a.length>1){a.splice(1,0,`"${b}"`);a.join(` `);}else{`${a}, a.k.a. "${b}"`;}}else{`Missing input!`;})

#354

Oh okay, that actually seems totally obvious to me now, haha.

Thank you so much for all the help!


#355

Hey!

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?

Thanks!


#356

Hi!

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?

https://twitch.center/customapi/quote/recover?token=PRIVATE_TOKEN

Thanks!


#357

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?


#358

It’s the same as for the addquote/delquote, but instead it’s editquote in the URL/command line:

delquote: $(urlfetch https://twitch.center/customapi/delquote?token=TOKEN;data=$(querystring))
editquote: $(urlfetch https://twitch.center/customapi/editquote?token=TOKEN;data=$(querystring))
(tbh, I don’t know if &amp has to be after the TOKEN)

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.