TimberBot

TimberBot is a general-purpose chat bot extensible via plugins and geared towards public chat rooms, particularly Twitch and Discord. It supports user roles and reacts to commands.

Background

Back in 2014 I used to visit a Twitch.tv stream with a small community attached. The initial version of TimberBot was not even developed for practical purposes, but just because we thought having a customizable chat bot around would be funny. What started as a tiny IRC bot with responses based on a small set of hardcoded conditionals quickly grew into a relatively full-featured bot that was able to support moderation processes and make chat communication a bit more engaging.

I made the bot available as a free service to a few friends with the shared understanding that they'd be part of a testing process and that it might fail in unpredictable ways. A small number of communities use it to this day. I host it for them and assist with configuration.

Technical Achievements

TimberBot plugin example

My desire was to make plugin development straightforward. All a plugin needs to do is implement a few specifically named functions to tap into the message loop.

The two most interesting aspects of TimberBot are its plugin system and its chat service versatility.

When it became untenable to keep all chat functionality in one big script, I decided to split it apart into plugins which the bot owner could then load and unload at runtime. This way, parts of the code that the owner does not intend to use cannot cause issues. Loading Python modules at runtime is fairly simple and the bot's codebase does all necessary error handling so a faulty plugin will not bring the whole bot down.

Timberbot was initially developed to connect to Twitch chat, which uses an IRC gateway. Connectors were later developed for general IRC servers, Picarto, Hitbox (discarded in 2016), Twitter direct messages (discarded in 2019) and Discord (still in use). I began work on connectors for Slack and YouTube Gaming, but dropped the efforts when it started to look like familiarizing myself with their APIs would not be worth it.

TimberBot portrait

Back in 2015 I commissioned an artist friend, AwkwardBex, to draw a mascot version of TimberBot to be used as its avatar in all the various chat services. I always customized the color of its eyes and cheeks to match whatever service it ran on. If you see TimberBot on Discord for example, you'll find its face colored in the service's characteristic light blue.

Fun fact: Its original name was supposed to be LumberBot, but that was dropped because the user account was already taken on Twitch.

Project Perspective

I have gone back and forth on what to do with TimberBot. At one point I wanted it to become a full-fledged service solution and even put initial considerations into a business plan. At its highest point, my own TimberBot installation serviced about a dozen channels across three chat services. None of them were particularly big and I don't think TimberBot ever funneled more than a few thousand messages per day, but I had aspirations for it.

Regrettably, TimberBot's formative years coincided with my transition from university studies into full-time employment and I found myself not having the free time necessary to turn it into a software service suitable for public use. With the bot in long-term use by some Twitch channels, issues in reliability became apparent: the bot would sometimes appear to “miss” individual messages or randomly drop out of the chat altogether. I was never able to find the true causes for these problems that appeared to be exclusive to long-term use scenarios, which made things challenging to test. Band-aid fixes were put in place, including a forced reset every 24 hours to reestablish any dropped network connections, but when it became increasingly apparent that TimberBot was not reliable enough to be trusted with essential moderation tasks, I also scaled back my aspirations for expansion.

There are other issues with TimberBot that are more architectural than practical. Early on I made the decision that all bot configuration and administration would take place in the same chat where the bot is used, via administrative commands. This simplified the project a great deal, since it did not need an interactive website that would allow for graphical configuration. But with the plugins now numbering almost 40, the strain that this decision puts on the bot owners (to memorize all the important commands and their syntax) has emerged as a limiting factor that makes me reluctant to add more complexity. At the same time, re-engineering the bot to have a proper interactive GUI would be such an involved task that it may as well be an entirely new project.

Over the years since 2017 we have let a few of the remaining TimberBot communities gently fade into the sunset, and now less than five channels still use it. I am in no rush to stop supporting them, and some channel owners relish the chance to introduce ideas for custom plugins with me as the coder, but I also think there is little hope for long-term growth.