summaryrefslogtreecommitdiff
path: root/CoupServ.py
diff options
context:
space:
mode:
Diffstat (limited to 'CoupServ.py')
-rwxr-xr-xCoupServ.py10
1 files changed, 5 insertions, 5 deletions
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)