From 7ac1542baee880942972b53ad26090316e16b6aa Mon Sep 17 00:00:00 2001 From: Swee Date: Sat, 12 Oct 2024 14:28:11 -0700 Subject: [PATCH] Update sweebot.py --- sweebot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sweebot.py b/sweebot.py index cb1ac92..1edaf91 100644 --- a/sweebot.py +++ b/sweebot.py @@ -16,7 +16,7 @@ class config: self.database = self.conn.cursor() def perms(self, cloak: str): try: - self.database.execute(f"SELECT * FROM users WHERE username = ?;", (cloak)) + self.database.execute(f"SELECT * FROM users WHERE username = ?;", [cloak]) output = self.database.fetchall() return output[0][1] except: @@ -24,7 +24,7 @@ class config: return '' def chansettings(self, chan: str): try: - self.database.execute("SELECT * FROM chans WHERE chan = ?;", (chan)) + self.database.execute("SELECT * FROM chans WHERE chan = ?;", [chan]) output = self.database.fetchall() temp = output[0][1].split(",") return temp if temp != [''] else [] @@ -35,9 +35,9 @@ class config: try: if self.chansettings(chan) == []: 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(?, '+config');", [chan]) 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]) except: print(traceback.format_exc())