Add delete_token()
This commit is contained in:
parent
9261247115
commit
f5f81f5a93
|
@ -169,4 +169,11 @@ class player():
|
||||||
token = str(uuid.uuid4())
|
token = str(uuid.uuid4())
|
||||||
query = ('INSERT INTO tokens(chat_id, token) values(?, ?)')
|
query = ('INSERT INTO tokens(chat_id, token) values(?, ?)')
|
||||||
cursor.execute(query, (self.CHAT_ID, token))
|
cursor.execute(query, (self.CHAT_ID, token))
|
||||||
|
self.DB.commit()
|
||||||
return token
|
return token
|
||||||
|
|
||||||
|
def delete_token(self, token):
|
||||||
|
cursor = self.DB.cursor()
|
||||||
|
query = ('DELETE FROM tokens WHERE chat_id = ? AND token = ?')
|
||||||
|
cursor.execute(query, (self.CHAT_ID, token))
|
||||||
|
self.DB.commit()
|
||||||
|
|
Loading…
Reference in New Issue