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
21
webapp/titanembeds/database/token_transactions.py
Normal file
21
webapp/titanembeds/database/token_transactions.py
Normal file
@ -0,0 +1,21 @@
|
||||
from titanembeds.database import db
|
||||
import datetime
|
||||
import time
|
||||
|
||||
class TokenTransactions(db.Model):
|
||||
__tablename__ = "token_transactions"
|
||||
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
|
||||
timestamp = db.Column(db.TIMESTAMP, nullable=False) # The timestamp of when the action took place
|
||||
action = db.Column(db.String(255), nullable=False) # Very short description of the action
|
||||
net_tokens = db.Column(db.Integer, nullable=False) # Net change of the token amount
|
||||
start_tokens = db.Column(db.Integer, nullable=False) # Token amount before transaction
|
||||
end_tokens = db.Column(db.Integer, nullable=False) # Tokens after transaction
|
||||
|
||||
def __init__(self, user_id, action, net_tokens, start_tokens, end_tokens):
|
||||
self.user_id = user_id
|
||||
self.timestamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
|
||||
self.action = action
|
||||
self.net_tokens = net_tokens
|
||||
self.start_tokens = start_tokens
|
||||
self.end_tokens = end_tokens
|
Reference in New Issue
Block a user