catch empty lines and thelike
This commit is contained in:
parent
57ba56bf2b
commit
f5d6f2deb0
5
irc.py
5
irc.py
@ -170,7 +170,12 @@ class Client:
|
||||
self.__server.sendline("PONG " + line.split()[1])
|
||||
continue
|
||||
|
||||
try:
|
||||
(msg_from, msg_type, msg_to, *msg) = line[1:].split()
|
||||
except ValueError:
|
||||
print("[E] Invalid message received:", line)
|
||||
continue
|
||||
|
||||
if len(msg) > 0 and msg[0].startswith(":"):
|
||||
msg[0] = msg[0][1:]
|
||||
message = " ".join(msg)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user