Help with Python Bot Disconnects After 10 Minutes

Thanks but, as I stated in the original post, I had code that responded to the Twitch Server PING and the bot would still disconnect. In an effort to diagnose if the PING response was the problem, the above code PINGs the server preemptively to keep the connection alive. It still disconnects.