Python BOT keeps disconnecting, even with PONGs

Hey, sorry it took me a while to respond.

I am trying out this code now then: http://pastebin.com/4yZr6m3C

Do you think that should work? I will come back and say how it’s going!