From 6987e85a44736d6eed4f961845401bc681b3c600 Mon Sep 17 00:00:00 2001 From: Swee Date: Mon, 6 Jan 2025 16:28:17 -0800 Subject: [PATCH] update --- kindirc.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/kindirc.py b/kindirc.py index 56d1d80..8cd21cd 100644 --- a/kindirc.py +++ b/kindirc.py @@ -35,6 +35,8 @@ global caps global shft global connected global nick +global socket +socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) nick = "kindle" connected = False caps = False @@ -58,8 +60,17 @@ def press(key:str): input.xview_scroll(500, tk.UNITS) def enter(): out = input.get() - if out.split(" ")[0] == "/connect": - insert("\nNot implemented.") + if out == "": + pass + if out[0] == "/": + if out.split(" ")[0] == "/connect": + insert("\nNot implemented.") + elif out.split(" ")[0] == "/nick": + if len(out.split(" ")) == 2: + global nick + nick = out.split(" ")[1] + if not connected: + insert(f"Nickname changed to {nick}") else: if connected: pass