forked from swee/MeowNex
Update sweebot.py
This commit is contained in:
parent
d387efe3b3
commit
7ac1542bae
1 changed files with 4 additions and 4 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue