Bot makers: what is more stable? One IRC client per user of the bot or one big IRC client?

I’m relatively new to developing twitch bots but I have a stable bot that I’m beginning to re-architect now that I’ve seen some of the limitations of my current code. It’s a hosted bot and at peak times I only have ~50 users using it.

My current design has a single IRC client per channel my bot joins and I’m curious if anyone has experience doing it this way vs one IRC client serving up multiple channels simultaneously. I don’t know if one may tend to be more stable long-term or not; obviously if my bot somehow got thousands of users one IRC client per user would be bad, but at a scale of only around 50 people does it really matter which approach I choose?

For reference, my bot is incredibly specialized so I doubt I’ll see its peak use grow that much. It’s a bot that tracks a Destiny game mode (Trials of Osiris).

Any thoughts on the matter would be appreciated. For the huge hosted bots (moo, night, etc) I have to assume they have one IRC client performing IRC duties for their users (or a farm of machines each serving up a set of users).

Another question: are rate limits per connection to the IRC chat, or are they per twitch account you’ve connected to the chat with? For example, if I connect to 50 different rooms with my bot account, each using a separate IRC client, am I rate limited across all 50 or is each one separate?

The large bots spread channels over multiple connections. It’s not one channel per connection, it’s more along the lines of 20-50 channels per connection.

A single channel per connection is not viable for huge bots. Each outgoing connection takes up a port and it’s a huge waste of resources, since the vast majority of the channels will be dead silent as well.

Everything on a single connection is bad, because if the connection drops, you need to join all those thousands, even tens of thousands of channels again, and that will take hours, possibly over a day.

So what you’re left with is a hybrid. You don’t spend a huge amount of resources and, if a connection drops, you’re not spending an eternity getting back up again. The downside? The code gets complicated.

Thanks. That’s pretty much what I figured and is the route I’ve drawn on my whiteboard. It’s also not something I’m looking forward to doing, so I may just keep 1 channel per connection until last :slight_smile:

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