mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 15:57:02 +01:00 
			
		
		
		
	Add voting page and track referrals
This commit is contained in:
		@@ -15,6 +15,7 @@ from .titan_tokens import TitanTokens, get_titan_token
 | 
			
		||||
from .token_transactions import TokenTransactions
 | 
			
		||||
from .patreon import Patreon
 | 
			
		||||
from .disabled_guilds import DisabledGuilds, list_disabled_guilds
 | 
			
		||||
from .discordbotsorg_transactions import DiscordBotsOrgTransactions
 | 
			
		||||
 | 
			
		||||
def set_titan_token(user_id, amt_change, action):
 | 
			
		||||
    token_count = get_titan_token(user_id)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								webapp/titanembeds/database/discordbotsorg_transactions.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								webapp/titanembeds/database/discordbotsorg_transactions.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
from titanembeds.database import db
 | 
			
		||||
import datetime
 | 
			
		||||
import time
 | 
			
		||||
 | 
			
		||||
class DiscordBotsOrgTransactions(db.Model):
 | 
			
		||||
    __tablename__ = "discordbotsorg_transactions"
 | 
			
		||||
    id = db.Column(db.Integer, primary_key=True)                    # Auto increment id
 | 
			
		||||
    user_id = db.Column(db.BigInteger, 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
 | 
			
		||||
    referrer = db.Column(db.BigInteger, nullable=True)              # Discord user id of the referrer
 | 
			
		||||
    
 | 
			
		||||
    def __init__(self, user_id, action, referrer=None):
 | 
			
		||||
        self.user_id = user_id
 | 
			
		||||
        self.action = action
 | 
			
		||||
        if referrer:
 | 
			
		||||
            self.referrer = referrer
 | 
			
		||||
        self.timestamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
 | 
			
		||||
		Reference in New Issue
	
	Block a user