Update sweebot.py

This commit is contained in:
Swee 2024-10-12 14:53:38 -07:00
parent dd3a93b2ef
commit 3dd7afc3b3

View file

@ -35,7 +35,8 @@ class config:
try: try:
if self.chansettings(chan) == []: if self.chansettings(chan) == []:
print("[!!!] Channel doesn't exist in config") print("[!!!] Channel doesn't exist in config")
self.database.execute("INSERT INTO chans (chan, flags) values(?, '+config');", [chan]) self.database.execute("INSERT INTO chans (chan, flags) values(?, ?);", [chan, ["+config"] + ",".join(flags)])
else:
self.database.execute("UPDATE chans SET FLAGS = ? WHERE chan = ?", [",".join(flags),chan]) self.database.execute("UPDATE chans SET FLAGS = ? WHERE chan = ?", [",".join(flags),chan])
self.conn.commit() self.conn.commit()
except: except: