mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2024-11-10 17:25:59 +08:00
fix table name
This commit is contained in:
parent
a2f29df98c
commit
43e8a9ecf4
2 changed files with 4 additions and 4 deletions
|
@ -84,7 +84,7 @@ class Redis:
|
|||
def show_usage(self):
|
||||
from downloader import sizeof_fmt
|
||||
db = MySQL()
|
||||
db.cur.execute("select * from VIP")
|
||||
db.cur.execute("select * from vip")
|
||||
data = db.cur.fetchall()
|
||||
fd = []
|
||||
for item in data:
|
||||
|
|
|
@ -39,14 +39,14 @@ def get_username(chat_id):
|
|||
class VIP(Redis, MySQL):
|
||||
|
||||
def check_vip(self, user_id: "int") -> "tuple":
|
||||
self.cur.execute("SELECT * FROM VIP WHERE user_id=%s", (user_id,))
|
||||
self.cur.execute("SELECT * FROM vip WHERE user_id=%s", (user_id,))
|
||||
data = self.cur.fetchone()
|
||||
return data
|
||||
|
||||
def add_vip(self, user_data: "dict") -> ("bool", "str"):
|
||||
sql = "INSERT INTO VIP VALUES (%s,%s,%s,%s,%s,%s);"
|
||||
sql = "INSERT INTO vip VALUES (%s,%s,%s,%s,%s,%s);"
|
||||
# first select
|
||||
self.cur.execute("SELECT * FROM VIP WHERE payment_id=%s", (user_data["payment_id"],))
|
||||
self.cur.execute("SELECT * FROM vip WHERE payment_id=%s", (user_data["payment_id"],))
|
||||
is_exist = self.cur.fetchone()
|
||||
if is_exist:
|
||||
return "Failed. {} is being used by user {}".format(user_data["payment_id"], is_exist[0])
|
||||
|
|
Loading…
Reference in a new issue