Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buf = ""
- while True:
- buf = buf + s.recv(1024).decode()
- if '\r\n' in buf:
- tmp = buf.split('\r\n')
- msg = tmp.pop(0)
- buf = '\r\n'.join(tmp)
- if msg == "PING :tmi.twitch.tv\r\n":
- s.send("PONG :tmi.twitch.tv\r\n".encode("utf-8"))
- print("---SENT PONG---")
- else:
- print(msg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement