IRC Bot disconnects with EOF unless it joins its own channel

Well, seems like the issue is resolved after disabling the built-in ping. However, since Carl said the builtin ping causes no issues for him, it could have very well been twitch somehow mistaking my bot for a spambot and dropping the connection. Now that i think about it I had started experiencing these issues only after switching the bot to its own newly created twitch account instead of my own.

Thanks everyone for the help, the bot has been up for 12+ hours now with no disconnects and without joining its own channel.