Response for PING in ircbot.

Bischoop Bischoop at vimart.net
Sat Jan 30 11:50:07 EST 2021



Got problem with responding for Ping, tried so many ways to response
and always end up with time out or other error. This time:

ERROR :(Ping timeout: 264 seconds)
Traceback (most recent call last):
    s.send(bytes('PONG ' + data.split()[1], 'UTF-8'))
BrokenPipeError: [Errno 32] Broken pipe

while True:
    time.sleep(2)
    data=s.recv(2040).decode('utf8')
    data = data.strip("\n\r")
    print(data)
    if data.find ("PING :"):
        s.send(bytes('PONG ' + data.split()[1], 'UTF-8'))

--
Thanks


More information about the Python-list mailing list