summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-19 10:27:31 -0400
committerTest_User <hax@andrewyu.org>2024-06-19 10:27:31 -0400
commit025dbf79426046e6d98839b18fa78b3e3ea6fad4 (patch)
tree0d40339316d938e62af4f7762432f0147adaad57
parentad5daa4049874de9a6e646e2b634535e6e0fd902 (diff)
downloadpy_coupserv-025dbf79426046e6d98839b18fa78b3e3ea6fad4.tar.gz
py_coupserv-025dbf79426046e6d98839b18fa78b3e3ea6fad4.zip
Fixes
-rw-r--r--.gitignore1
-rwxr-xr-xCoupServ.py10
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)