Nightbot Giveaway Help PLEASE!

Hey @makima_nayuta!

Nightbot giveaway keywords can only spot the keyword you set, messages to enter the giveaway have to match the keyword you set (case insensitive), and it can’t store arguments.

To get the winner’s IGN, you simply ask them once they were picked, or you can set up the Quote API to work as a temporary database (I don’t recommend it), with its command name matching the keyword you set for your giveaway:

  • !giveawayKeyword:

    $(eval const response = '$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(user) $(query)'; response.includes('Successfully') ? '$(user) entered the giveaway' : '$(user) There was an error, try again later';)
    
  • !giveawayReset:

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

!giveawayKeyword will store the chatter’s IGN at the following URL, all you have to do is search (Ctrl + F) the winning username:
https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN
Once the giveaway is done, clear the quote API with !giveawayReset.

You need to replace PUBLIC_TOKEN and PRIVATE_TOKEN with your tokens, you can get them by following the Manual installation of the Quote API. You’ll find your tokens as such:

$(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 commands containing it from the dashboard . Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.

Note that there can be some issues with the Quote API solution as the API will rate-limit the entries, therefore too many people trying to enter at once could produce errors, hence why I can’t really recommend you use the Quote API.