This commit is contained in:
parent
c345c7bb9a
commit
9b3a6bd083
1 changed files with 13 additions and 2 deletions
|
@ -19,6 +19,7 @@ class broker:
|
||||||
db = self.conn.cursor()
|
db = self.conn.cursor()
|
||||||
db.execute("SELECT * FROM nickserv WHERE user=?;", [nick])
|
db.execute("SELECT * FROM nickserv WHERE user=?;", [nick])
|
||||||
e = db.fetchall()
|
e = db.fetchall()
|
||||||
|
db.execute("SELECT * FROM groups WHERE ")
|
||||||
if e == []:
|
if e == []:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
@ -34,6 +35,16 @@ class broker:
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
def nickserv_isexist(self, nick):
|
def nickserv_isexist(self, nick):
|
||||||
db = self.conn.cursor()
|
db = self.conn.cursor()
|
||||||
db.execute("SELECT * FROM nickserv WHERE user=?;", [nick])
|
db.execute("SELECT * FROM nickserv WHERE user=?;", [nick.lower()])
|
||||||
e = db.fetchall()
|
e = db.fetchall()
|
||||||
return e != []
|
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()])
|
Loading…
Add table
Reference in a new issue