Twitch bot doesn't send PONG after PING

for some reason my bot is not responding to PING which makes my bot disconnect.

                    if len(line) >= 1:
                        if data.find('PING') != -1:
                            con.send(bytes(data.replace('PING', 'PONG'), "UTF-8"))
                            print("PONG :tmi.twitch.tv")
                        else:
                            sender = get_sender(line[1]).lower()
                            message = get_message(line[1:])
                            parse_message(message)

This is on python 3.5

I have tried this

  def PONG():
      con.send(bytes('PONG :tmi.twitch.tv\r\n', 'UTF-8'))
      print("PONG SENT!")
      threading.Timer(300, PONG).start()
  PONG()

Hoping it works now

THIS WORKS.

I DON’T NEED HELP ANYMORE :slight_smile: