Yeah, so here’s how it’d work:
Moderators’ command:
Add it from the dashboard, make sure to set the userlevel as Moderator
. Don’t use the chat as anyone could monitor it and copy the PRIVATE_TOKEN
, they could then edit your data.
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(querystring),)
Everyone’s command:
!addcom !list $(eval u=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`,`);u.pop();`List of items: ${u.join(`, `)}. Consult the full list here: https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN`})
Or if you get too many items that it reaches more than 400 characters, I can recommend picking items at random from the list, in this example you’ll get 10 items, 9 at random, the 10th being the last entered item. If you want more items, feel free to replace the 9 in the for
loop with another number:
!addcom !list $(eval u=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`,`);u.pop();t=u.length;s=[];l=u.pop();for(i=0;i<9;i++){s.push(u.splice(Math.floor(Math.random()*u.length),1));}`Here's a small selection of the items in the list: ${s.join(`, `)}, and ${l}. Total: ${t} items. Consult the full list here: https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN`})
You’ll get your TOKENS
by clicking on the second link in the quote system API post, in the Manual Installation section, use these in the commands I wrote. To know where to look for your PUBLIC_TOKEN
and PRIVATE_TOKEN
, look at the field bellow:
$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&data=$(querystring))
Keep your PRIVATE_TOKEN
secret, don’t share it anywhere. Add the following commands from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.