From 2680cf6d154dde050b847ea28f0e9c9a2bb8e466 Mon Sep 17 00:00:00 2001 From: Nova Cat Date: Wed, 11 Dec 2024 14:55:35 -0800 Subject: [PATCH] restart command --- server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server.py b/server.py index a76e23a..d572abb 100644 --- a/server.py +++ b/server.py @@ -346,6 +346,13 @@ def session(connection, client): connection.sendall(bytes(f":GitServ!~IRCat@IRCatCore NOTICE {pending} :PULL - Pulls the latest version of Codename IRCat\r\n","UTF-8")) connection.sendall(bytes(f":GitServ!~IRCat@IRCatCore NOTICE {pending} :VERSION - Gets the version number of this service.\r\n","UTF-8")) + elif command == "RESTART": + if "o" in property_list[pending]["modes"]: + tcp_socket.shutdown(socket.SHUT_RDWR) + tcp_socket.close() + else: + connection.sendall(bytes(f":{server} 481 {pending} :Permission Denied- You're not an IRC operator\r\n","UTF-8")) + elif command == "PRIVMSG": if len(args) >= 2: target = text.split(" ")[1]