Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. buf = ""
  2.  
  3.     while True:
  4.         buf = buf + s.recv(1024).decode()
  5.         if '\r\n' in buf:
  6.             tmp = buf.split('\r\n')
  7.             msg = tmp.pop(0)
  8.             buf = '\r\n'.join(tmp)
  9.             if msg == "PING :tmi.twitch.tv\r\n":
  10.                 s.send("PONG :tmi.twitch.tv\r\n".encode("utf-8"))
  11.                 print("---SENT PONG---")
  12.             else:
  13.                 print(msg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement