Update client.py
This commit is contained in:
@@ -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
|
|
||||||
try:
|
|
||||||
index = int(bericht.split(" ", 1)[1])
|
|
||||||
s.sendall(json.dumps({
|
s.sendall(json.dumps({
|
||||||
"action": "remove_message",
|
"action": "remove_message",
|
||||||
"chat_name": chatkeuze,
|
"chat_name": chatkeuze,
|
||||||
"index": index,
|
|
||||||
"by": current_user
|
"by": current_user
|
||||||
}).encode("utf-8"))
|
}).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":
|
||||||
|
|||||||
Reference in New Issue
Block a user