Inspiration
This started as a reaction the StreamElements and Gleam.io's giveaway functionality. We wanted to dynamically adjust the odds of winning based on what the viewers are already doing, watching and interacting with the stream.
What it does
Via its web interface you can start a new giveaway and configure it. The bot will become available in your chat and viewers will be able to enter with a simple command. The bot will also start monitoring you, so that when you're live it'll be recurrently be giving tickets to the viewers of your stream. When you're done with the giveaway you can end it via the website and a winner will be picked, with the users with the most tickets being more likely to win, and after applying all the filters you may have configured (blacklist, only followers, minimum account age...)
How we built it
This started as an extension of an older POC that would simply connect to the Twitch chat via IRC and keep track of the viewers via the undocumented back then chatters endpoint. For the hackathon the website was created instead of only allowing chat commands to interact and configure the bot. The bot itself is separated into a main process that handles the chat interactions and recurrent tasks and the API used by the website.
Challenges we ran into
The first big step was the migration from IRC to conduits and eventsub, and in particular all the failsafes that need to be put into place. Some issues were only apparent when the bot was live so having a first version out as soon as possible and working on it incrementally was a huge factor in making something very resilient and scalable. Three particularly interesting examples were rate limits (which were solved with a time based queue system), random errors from twitch's side (The API replying with "Internal Server Error") and token refreshing.
Accomplishments that we're proud of
We have so far a decent user base that's been actively testing the bot. They have been very reactive and useful in raising issues and getting them solved as fast as possible. The website is very professional and intuitive, and has been designed with great care, both for streamers who will be using it the most, but also for viewers that can use it as a source to discover new talent.
What we learned
This was made by a one man team, it was the first time I had done something that was this much linked to an external service. The amount of things you need to think about and how you test them are completely different as when you do your own thing almost in isolation. It was also my first time using Solid.js, the framework used for the website. I really liked and will be using it for future projects.
What's next for Tom's Giveaway Bot
We are continuously working on new features and have already a roadmap in place, mainly centered about giving more information to the viewers, creating more interactive experiences and giving streamers more tools to really create a giveaway tailored to their needs.
Log in or sign up for Devpost to join the conversation.