# IRC bot disconnecting

**URL:** <https://staging-discuss.dev.twitch.com/t/irc-bot-disconnecting/24895>\
**Category:** Chat and IRC\
**Created:** [April 10, 2020, 3:33am UTC](https://staging-discuss.dev.twitch.com/t/irc-bot-disconnecting/24895 "2020-04-10T03:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thecalvo2](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thecalvo2](https://staging-discuss.dev.twitch.com/u/thecalvo2)\
**Post date:** [April 10, 2020, 3:33am UTC](https://staging-discuss.dev.twitch.com/t/irc-bot-disconnecting/24895/1 "2020-04-10T03:33:31Z")

</div>

Hi, I’m was working with bots in twitch for a while and the last month they are working perfecly, the bot was in more than 20.000 channels without any problem. But this month I’m getting disconnects all the time, twtich literally close the socket.

I’m using the same code for others IRC server without any problem, the bots are working fine, like in twtich the last month.

I’m respecting the rate rule (20/30), the socket is not full of charge, all the things look fine and I don’t understand why at the moment twtich are closing the connection. Usually if I have only 1 robot working, and I open and normal MIRC to check it, when I’m in a few channels the connection of both (robot and mirc) is closed without any reason.

Any can help me to understand where can be the problem? I’m trying to get verified yesterday to try if this can be the problem, but as I said I’m having troubles from a 1 or 2 weeks ago.

All the ideas and help will appreciated 🙂

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [April 10, 2020, 9:48am UTC](https://staging-discuss.dev.twitch.com/t/irc-bot-disconnecting/24895/2 "2020-04-10T09:48:44Z")

</div>

> [@thecalvo2](#):
>
> I’m using the same code for others IRC server without any problem, the bots are working fine, like in twtich the last month.

Sounds like your ISP/Server provider, is just having a bad route to Twitch.

I get it now and again.

Either that, or you are joining too many channels, and your message receive buffer is exceeding the unknown limit and Twitch is disconnecting you to stop the queue getting too long. So if you are a multi channel bot, you need to spread your channels across multiple instances of your bot to avoid the send buffer full issue.

> [@thecalvo2](#):
>
> Any can help me to understand where can be the problem? I’m trying to get verified yesterday to try if this can be the problem, but as I said I’m having troubles from a 1 or 2 weeks ago

Verification doesn’t help with disconnects.

I’m assuming you have already checked all of your send logic to check you are within the limits, and last I checked if you exceed the limit, a global block is still 30 minutes. So If you do get globalled, you won’t be able to insta connect, so it’s not you hitting a limit.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [May 10, 2020, 9:48am UTC](https://staging-discuss.dev.twitch.com/t/irc-bot-disconnecting/24895/3 "2020-05-10T09:48:47Z")

</div>

Closed on May 10, 2020, 9:48am UTC

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