From 9b3a6bd0832752f5830b6098d9ca51f82b747384 Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 29 Jan 2025 20:51:09 -0800 Subject: [PATCH] Update modules/sqlite_local.py --- modules/sqlite_local.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/sqlite_local.py b/modules/sqlite_local.py index 03af7e4..af81785 100644 --- a/modules/sqlite_local.py +++ b/modules/sqlite_local.py @@ -19,6 +19,7 @@ class broker: db = self.conn.cursor() db.execute("SELECT * FROM nickserv WHERE user=?;", [nick]) e = db.fetchall() + db.execute("SELECT * FROM groups WHERE ") if e == []: return False else: @@ -34,6 +35,16 @@ class broker: self.conn.commit() def nickserv_isexist(self, nick): db = self.conn.cursor() - db.execute("SELECT * FROM nickserv WHERE user=?;", [nick]) + db.execute("SELECT * FROM nickserv WHERE user=?;", [nick.lower()]) e = db.fetchall() - return e != [] \ No newline at end of file + db.execute("SELECT * FROM groups WHERE name=?;", [nick.lower()]) + f = db.fetchall() + return e != [] or f != [] + def nickserv_group(self, nick, account): + db = self.conn.cursor() + db.execute("INSERT INTO groups VALUES (?, ?);", [nick.lower(), account.lower()]) + self.conn.commit() + def nickserv_drop(self, account): + db = self.conn.cursor() + db.execute("DELETE FROM nickserv WHERE user=?;", [account.lower()]) + db.execute("DELETE FROM groups WHERE owner=?;", [account.lower()]) \ No newline at end of file