Update client.py

This commit is contained in:
2026-02-17 11:04:28 +01:00
parent 7f8e8a4baf
commit ca4c258d07

View File

@@ -185,18 +185,13 @@ def chat_session(chatkeuze):
if bericht.lower() == "/quit": if bericht.lower() == "/quit":
exit() exit()
elif bericht.lower().startswith("/rm "): elif bericht.lower() == "/rm":
# verwacht: /rm 3 → verwijdert bericht index 3 s.sendall(json.dumps({
try: "action": "remove_message",
index = int(bericht.split(" ", 1)[1]) "chat_name": chatkeuze,
s.sendall(json.dumps({ "by": current_user
"action": "remove_message", }).encode("utf-8"))
"chat_name": chatkeuze,
"index": index,
"by": current_user
}).encode("utf-8"))
except:
print("Ongeldige index")
elif bericht.lower() == "/break": elif bericht.lower() == "/break":
break break
elif bericht.lower() == "/users": elif bericht.lower() == "/users":