Need Help with API Limitations and Socket Disconnections

Hello Twitch community,

I’m the developer of a moderation and custom command chatbot for Twitch. Recently, I launched a feature called Bot Firewall that blocks massive follow attacks in real-time. It has become very popular among the community, and my bot has grown exponentially. However, I am facing some issues with API limitations and socket disconnections.

Currently, I have over 40,000 streamers using my bot, and the API limit is “20 join attempts per 10 seconds per user.” Unfortunately, the Twitch API disconnects the socket for a second, which makes it hard for my bot to reconnect with all the channels. It takes hours to reconnect, and sometimes during the reconnection, there is another micro cut, and the process starts all over again.

I have filled out the verification form for my bot a few weeks ago, but I haven’t received a response yet. Additionally, I have tried contacting Twitch through “dxr-support@twitch.tv,” but I haven’t received a reply.

My users think it’s a problem with my bot, but the real issue is with the Twitch servers. Can someone please guide me on how to solve this issue? I would appreciate any help or advice from the Twitch community.

Thank you in advance for your time and assistance.

Why does your bot need to be in chat to do something about follows?

My chatbot has multiple features, including customized commands and moderation tools. The Bot Firewall is just one of the functions of my chatbot.

Unfortunately, the Twitch API disconnects the socket for a second, which makes it hard for my bot to reconnect with all the channels

Can you expand on what you mean by “the Twitch API disconnects the socket for a second”? I’m not familiar with anything that should be doing that.

Are you joining all the channels on one connection?

How are you handling RECONNECT messages?

To clarify, I am connecting to the Twitch chat using a WebSocket. Normally, the socket can remain connected for several days without any issues. However, there are times when the WebSocket connection closes, and I need to reconnect.

I am using two connections to join the channels. Previously, I used many more connections (one connection per 200 channels), but all the sockets started closing (This was running smoothly until it had about 10,000 users.), so I reduced the number of connections.

I am managing the reconnection with a queue. Every 500ms, I join a channel, but reconnecting to 40,000 channels at that speed takes many hours.

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