1
0
Fork 0
forked from swee/MeowNex

fix config command

This commit is contained in:
Swee 2024-10-12 14:38:58 -07:00
parent 7ac1542bae
commit 4922497637

View file

@ -38,7 +38,7 @@ class config:
self.database.execute("INSERT INTO chans (chan, flags) values(?, '+config');", [chan]) self.database.execute("INSERT INTO chans (chan, flags) values(?, '+config');", [chan])
flag = self.chansettings(chan) + flags flag = self.chansettings(chan) + flags
self.database.execute("UPDATE chans SET FLAGS = ? WHERE chan = ?", [",".join(flag),chan]) self.database.execute("UPDATE chans SET FLAGS = ? WHERE chan = ?", [",".join(flag),chan])
self.conn.commit()
except: except:
print(traceback.format_exc()) print(traceback.format_exc())
return False return False
@ -489,9 +489,22 @@ while True:
elif command[0] == "$config": elif command[0] == "$config":
try: try:
if len(command) > 2: if len(command) > 1:
if perms == "full": if perms == "full":
pass flag = sbconfig.chansettings(channel)
for i in command[2:]:
if i == "clear":
flag = ["+config"]
if i[0] == "+":
if "-" + i[1:] in flag:
flag[flag.index("-" + i[1:])] = i
elif i[0] == "-":
if "+" + i[1:] in flag:
flag[flag.index("+" + i[1:])] = i
else:
multiline(nick + ": flag name should begin with + or -")
break
sbconfig.setchanconfig(channel, flag)
else: else:
irc.send_irc(channel, nick + ": Permission denied") irc.send_irc(channel, nick + ": Permission denied")
block+=1 block+=1