Update server.py
This commit is contained in:
parent
06ed603560
commit
0fdf93d47a
1 changed files with 3 additions and 1 deletions
|
@ -48,6 +48,8 @@ def session(connection, client):
|
||||||
try:
|
try:
|
||||||
textt = data.decode()
|
textt = data.decode()
|
||||||
command = text.split(" ")[0].upper()
|
command = text.split(" ")[0].upper()
|
||||||
|
try:
|
||||||
|
args = text.split(" ")[1:]
|
||||||
for text in textt.split("\r\n"):
|
for text in textt.split("\r\n"):
|
||||||
if command == "NICK":
|
if command == "NICK":
|
||||||
pending = text.split(" ")[1]
|
pending = text.split(" ")[1]
|
||||||
|
@ -135,7 +137,7 @@ def session(connection, client):
|
||||||
elif target in nickname_list:
|
elif target in nickname_list:
|
||||||
nickname_list[target].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8"))
|
nickname_list[target].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8"))
|
||||||
else:
|
else:
|
||||||
nickname_list[target].sendall(bytes(f":{server} 401 {pending} {target} :No such nick/channel\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 401 {pending} {target} :No such nick/channel\r\n","UTF-8"))
|
||||||
nickname_list[i].sendall(bytes(f":{server} 366 {pending} {channel} :End of /NAMES list.\r\n","UTF-8"))
|
nickname_list[i].sendall(bytes(f":{server} 366 {pending} {channel} :End of /NAMES list.\r\n","UTF-8"))
|
||||||
elif command == "QUIT":
|
elif command == "QUIT":
|
||||||
# Parse the quit message.
|
# Parse the quit message.
|
||||||
|
|
Loading…
Reference in a new issue