mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-07-04 20:25:25 +02:00
Paypal (#41)
* Implement Titan Tokens clientside * Titan Tokens can be modified in the admin panel
This commit is contained in:
committed by
GitHub
parent
d363b66799
commit
8bc95f7b0e
18
webapp/titanembeds/database/titan_tokens.py
Normal file
18
webapp/titanembeds/database/titan_tokens.py
Normal file
@ -0,0 +1,18 @@
|
||||
from titanembeds.database import db
|
||||
|
||||
class TitanTokens(db.Model):
|
||||
__tablename__ = "titan_tokens"
|
||||
id = db.Column(db.Integer, primary_key=True) # Auto increment id
|
||||
user_id = db.Column(db.String(255), nullable=False) # Discord user id of user
|
||||
tokens = db.Column(db.Integer, nullable=False, default=0) # Token amount
|
||||
|
||||
def __init__(self, user_id, tokens):
|
||||
self.user_id = user_id
|
||||
self.tokens = tokens
|
||||
|
||||
def get_titan_token(user_id):
|
||||
q = db.session.query(TitanTokens).filter(TitanTokens.user_id == user_id).first()
|
||||
if q:
|
||||
return q.tokens
|
||||
else:
|
||||
return -1
|
Reference in New Issue
Block a user