Sanity check for single-purpose chatbot

I am considering developing a Twitch Chatbot to support a single feature: aid in the management of “follower games” with optional priority ordering of subscribers versus non-subscribers. However, the more I look into the work involved in setting up a chat bot, the more I feel the cost/benefit is out of whack.

Is it sensible to build a bot from scratch to serve this purpose? Is there instead an open-source bot that I could simply contribute to? Such a bot would need to be lightweight enough to not interfere with steamers’ workflow that are already happy with their existing bots minus this one feature.

If building a bot from scratch is reasonable, am I making a mistake by selecting python as my language of choice? I can develop in nearly any language, but dislike JavaScript on principle. Yet, it seems I might need to re-implement many layers if I want to take a different path.

Please let me hear your opinions.

I don’t really know what “follower games” refers to, so please explain what that means so I can better help.

Working with IRC, in my opinion, has proven to be incredibly easy. Twitch has some quirkiness due to a host of features it does not support, as well as things liked cached joins, but it still isn’t bad. Working with Python sockets is painless. It is my language of choice as well, and I have not come across anything out of the ordinary.

If this is intended to be a multi-channel bot, you’re going to need to work around some Twitch limitations. 100 commands per 30 seconds per connection (for channels in which your bot is modded) is the main one. I would suggest making your bot a class, and spawn multiple instances of it as needed to work around limitations. Some people also use separate connections for sending and receiving.

My true “should you build it from scratch or not” answer can only come after you answer the first part of this reply, however. Good luck.

I am glad to hear that. The logic for follower games is incredibly simple. I wasn’t aware it was not a common thing on Twitch. (I am somewhat new to Twitch.) Follower games, at least in Hearthstone, is when the streamer takes some time to play with viewers. The feature to support is the ability for moderators to be able to add and remove viewer names from a queue. Additionally, the ability to prioritize subscribers in this queue above non-subscribers is a desired feature. Really simple stuff.

If the work involved is truly not much more than any old IRC bot, I’m happy to write this up. I don’t really care if this becomes a multi-channel bot – this is to be a little gift to a particular streamer, although I’ll put the source code up on github in the event someone wants to fork it and support more features.

Okay, yeah, ‘follower games’ is a common term on Twitch. Based on your description alone, I wasn’t sure if it was referring to the common term or not. This is not a complicated task, and if this is for a particular streamer, as opposed to a bot that is going to be in hundreds of channels, the situations that you have to prepare for are minimal.

This is definitely simple enough that a simple socket bot could be written relatively painlessly.

Thanks. That leaves the only unknowns a) How to deal with Authentication/Permissions (which I can probably figure out on my own), and b) Where I can test this bot without interfering with any live streams.

If you are refering to the OAuth token necessary for your bot to connect to IRC, it can be retrieved here. If you are talking about the invidual user’s permission to call certain commands, then you can simply permit the user with the same name as the stream (the channel owner) and any user with a mod tag.

Passing “CAP REQ” to the server will enable messages in the form:

@color=#0000FF;emotes=16156:0-7;subscriber=1;turbo=0;user_type=mod :joe_user! PRIVMSG #somerandomchannel:lirikMLG is awesome!

user_type will either hold the value mod, global_mod, admin, staff or be empty.

When you are sure that the bot only listens to the channel, you can have it join any channel without problems. For safe testing I use my own channel and use my own account or ask friends to post test messages.

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