From 025dbf79426046e6d98839b18fa78b3e3ea6fad4 Mon Sep 17 00:00:00 2001 From: Test_User Date: Wed, 19 Jun 2024 10:27:31 -0400 Subject: Fixes --- .gitignore | 1 + CoupServ.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 43b648d..132efda 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ CoupServConfig.json +CoupServTmp.json diff --git a/CoupServ.py b/CoupServ.py index 0e5cbfd..138ddc8 100755 --- a/CoupServ.py +++ b/CoupServ.py @@ -238,8 +238,8 @@ try: elif command == b"PRIVMSG": try: if userlist[source]["opertype"] == b"NetAdmin": - if args[0] == config["sid"].encode("UTF-8")+b"000000" or (args[0][0] == b"#" and args[1][0] == b"-"): - if args[0][0] == b"#": + if (args[0] == config["sid"].encode("UTF-8")+b"000000") or (args[0][0:1] == b"#" and args[1][0:1] == b"-"): + if args[0][0:1] == b"#": chan = args[0] resp = chan args[1] = args[1][1:] @@ -250,7 +250,7 @@ try: cmd = args[1].split(b" ")[0].lower() argv = args[1].split(b" ")[1:] - send(b":"+config["sid"].encode("UTF-8")+b"000000 PRIVMSG "+config["log_chan"].encode("UTF-8")+b" :"+userlist[source]["nick"].encode("UTF-8")+b" executed command: "+args[1]) + send(b":"+config["sid"].encode("UTF-8")+b"000000 PRIVMSG "+config["log_chan"].encode("UTF-8")+b" :"+userlist[source]["nick"]+b" executed command: "+args[1]) if len(cmd) == 0: continue @@ -283,8 +283,8 @@ try: for _ in range(0, int(argv[1])): send(b":"+config["sid"].encode("UTF-8")+b" PRIVMSG "+argv[0]+b" :"+b" ".join(argv[2:])) elif cmd == b"join": - send(b":"+config["sid"].encode("UTF-8")+b"000000 FJOIN "+argv[0]+b" "+str(math.floor(time.time()))+b" + :,"+config["sid"].encode("UTF-8")+b"000000") - config["channels"][argv[0]] = True # actual value doesn't matter + send(b":"+config["sid"].encode("UTF-8")+b"000000 FJOIN "+argv[0]+b" "+str(math.floor(time.time())).encode("UTF-8")+b" + :,"+config["sid"].encode("UTF-8")+b"000000") + config["channels"][argv[0].decode("UTF-8", "surrogateescape")] = True # actual value doesn't matter save() elif cmd == b"part": send(b":"+config["sid"].encode("UTF-8")+b"000000 PART "+resp) -- cgit v1.2.3