How quick did your bot get disconnected? I got something similar the past few days with my own bot from a remote server not in my network but it didn’t get disconnected right away. (It did so, however, about a minute after it mysteriously stopped receiving data including pings and pongs from group chat servers, and I had to restart the whole thing to get it back up working. I’m currently investigating its cause as of writing.) And are you running your bot from your own network?
EDIT: The problem is a mistake in my own code that causes an infinite loop and therefore preventing my bot to do anything. You should check for them in your code just in case.