Python reading Twitch chat but keeps disconnecting after a few hours reddit / irc ---------------------------------------------------------------------- Tyurru92 路 2018-02-19 10:11 #Define the imports import twitch import keypresser import pyautogui import time t = twitch.Twitch(); k = keypresser.Keypresser(); #Enter your twitch username and oauth-key below, and the app connects to twitch with the details. #your oauth-key can be generated at http://twitchapps.com/tmi/ username = ""; key = ""; t.twitch_connect(username, key); #The main loop while True: #Check for new mesasages new_messages = t.twitch_recieve_messages(); if not new_messages: #No new messages... continue else: for message in new_messages: #Wuhu we got a message. Let's extract some details from it msg = message['message'].lower() username = message['username'].lower() print(username + ": " + msg); That's all and usually it works fine, but after a few hours the bot is disconnected from twitch and doesn't receive any messages and I don't know why, can someone help me out please? ---------------------------------------------------------------------- nosebleed_tv 路 2018-02-19 16:47 Ping pong events? ---------------------------------------------------------------------- Tyurru92 路 2018-02-19 17:15 I have to say, I'm a newbie in programming so uhm what's ping pong? 馃槄 ---------------------------------------------------------------------- nosebleed_tv 路 2018-02-19 18:54 If youre connected to a server it will send a ping and wait for a pong response. You would have to code a listener and response to that event. If youre new id say learn to use node.js for twitch and use tmi.js package ---------------------------------------------------------------------- Tyurru92 路 2018-02-19 20:14 Ok nice, thanks for the explanation :) ---------------------------------------------------------------------- nosebleed_tv 路 2018-02-19 23:08 If youre stuck ive made bots for twitch in python and node.js so you can message me. ---------------------------------------------------------------------- Tyurru92 路 2018-02-19 23:35 Ok cool, thank you! :)