Submit words through Nightbot

Hi there. I’m a mod in a community where we take a lot of suggestions from the chat on renamable stuff in-game, like city names in Civ 6 or Character names. I’m looking for a way for people to submit their suggestions through the bot without using an exterior source like Google Forms. Would there be a way for people to use a command to submit suggestions and have the bot make them accessible to mods elsewhere?

Hey @Typically_Thomas!

Have a look at the Quote System Custom API:

Hi Emily,

We’re already using this command but I don’t see how we could make something like this work for what I need. I’m not looking to get quotes but to have people send in suggestions for stuff which we then get in a list. This Custom API is exactly what I’m talking about, but this only works for Twitch and we’re on YouTube only: https://community.nightdev.com/t/custom-api-collect-suggestions-from-chat-into-a-votable-list-with-showbot/17403

The idea is for someone to submit a word or phrase that we can see in a list as moderators to choose one.

Yes, I perfectly understand your need, that’s why I recommended the Quote System. I thought you could figure by yourself how to set it up for your needs by reading the original post since it’s simple and explained pretty well, but here’s a guide.

You’ll get your extra TOKENS by clicking on the second link in the post, in the Manual Instalation part, 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. To add a command containing your PRIVATE_TOKEN do it from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.


Then to set up the commands it’s very simple:
!submit: this is the command through which people will be able to submit suggestions.

 $(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(querystring))

!submissions: this is the command mods can call to get the link to see every suggestions.

https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN

!clearsubmissions: this is the command to empty the suggestions list, make sure to set its userlevel to Moderator.

$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)

Since you don’t need people to vote on the suggestions this will be enough.


If however you still need to have a vote this is where it gets complicated, this could do the job:
!vote [suggestion id]:

$(eval q=`$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(querystring))`.split(` `);n=q.shift();isNaN(n)?q=`1 ${n} ${q.join(` `)}`:q=`${n++} ${q.join(` `)}`;`PRIVATE_TOKEN&data=$(querystring) ${q}`)

Add _vote in the alias field of !vote. As for the _vote command here’s the code:

$(urlfetch https://twitch.center/customapi/editquote?token=$(querystring))

The amount of votes will be put at the beginning of the suggestions, right after the suggestion id.
If only mods can vote make sure both of these commands’ userlevels are set to Moderator.

Thank you very much, Emily. That’s very helpful :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.