Inspiration
As startup Twitch streamer ourselves, we wish we had a Twitch bot to assist our moderators with monitoring toxicity in our chat. We hope to create a better and less toxic Twitch community, especially during these times with the pandemic going on. Now more than ever, people rely on Twitch as a means to connect with the outside world, so we would like to keep this form of connection as welcoming as possible.
What it does
Meet Swishy, our Twitch bot. Swishy conducts real-time sentiment analysis of Twitch chat, leveraging Google Cloud NLP to identify and single out users who consistently display toxic behavior in chat, remedying many of the issues present within large as well as small Twitch channels and providing long term monitoring over chats.
Moderators are not always able to keep track of chat and streamers need to focus on their games so our bot keeps track and conducts sentiment analysis on each message every user in your chat sends. Once a user passes a customizable negativity threshold, currently online channel mods are alerted and provided with that user’s ID as well as their negative messages, allowing the mods to decide upon the corresponding action. Within larger Twitch channels, our bot will assist in sifting through the hundreds if not thousands of messages that flood through the chat.
How I built it
We built the bot as a Java application. We utilized Twirk, which allowed us to connect to Twitch channels, read chat messages, and send moderation messages to chat in Java. Aside from Twirk, we used the Google Cloud NLP API in order to determine the toxicity of the incoming chat messages, using the average sentiment of the past four messages from each user. Finally, we used the Twitch IRC API in order to obtain the list of moderators for each channel, so that the bot can @ them when toxicity is detected.
Challenges I ran into
One of the most difficult parts of this application was how to get the list of moderators from a certain stream. The API we were using was broken in that it would always return an empty list of moderators. Thus, we had to derive our own unique implementation. We were able to parse info from Twitch IRC API in JSON format and continuously check that information to keep an up to date list of moderators. We were also able to fuse together multiple APIs which were not meant to work together such as (Twirk, Google Cloud NLP, Twitch API).
Accomplishments that I'm proud of
We have a fully functional Twitch bot that has been heavily tested. I’m proud we were able to finish our project within a day. We also created on the fly workarounds to buggy libraries and APIs
What I learned
We learned how to work as a team, as well as how to work around issues. We were able to create a plan that would emphasize the strengths of each member, since each aspect of the project appealed to different team member strengths. We also learned how to use various APIs such as Twirk, Twitch IRC, and Google Cloud NLP.
What's next for SwishyModBot
- Implement Google Cloud Auto-ML NLP to adjust SwishyBot to each specific Twitch Channel’s emotes, slang, and jargon
- Move SwishyBot into a webapp, shifting its place from a Twitch Bot into a chat client which will specifically display messages from high toxicity users, allowing even more streamlined approaches to moderating.
- Check for spam in addition to sentiment.
- Add additional customizable functionality for autobanning and auto kicking extremely toxic users.
Be like Swishy. Swishy is a good crewmate


Log in or sign up for Devpost to join the conversation.