Update server.py

This commit is contained in:
Nova Cat 2024-12-12 08:45:11 -08:00
parent c8d2b34339
commit 8d73dda78b

View file

@ -116,7 +116,7 @@ def session(connection, client):
args = text.split(" ")[1:] args = text.split(" ")[1:]
except: except:
pass pass
if command == "NICK": if command == "NICK" and not already_set:
pending = text.split(" ")[1] pending = text.split(" ")[1]
if pending[0] == ":": pending[1:] if pending[0] == ":": pending[1:]
if "!" in pending or ":" in pending or "#" in pending or "*" in pending: if "!" in pending or ":" in pending or "#" in pending or "*" in pending:
@ -126,7 +126,6 @@ def session(connection, client):
connection.sendall(bytes(f":{server} 433 * {pending} :Nickname is already in use.\r\n","UTF-8")) connection.sendall(bytes(f":{server} 433 * {pending} :Nickname is already in use.\r\n","UTF-8"))
pending = "*" pending = "*"
else: else:
if not already_set:
already_set = True already_set = True
print(f"User {pending} set nick") print(f"User {pending} set nick")
elif command == "USER": elif command == "USER":