mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 15:57:02 +01:00 
			
		
		
		
	Implement Patreon token syncer
This commit is contained in:
		@@ -14,6 +14,7 @@ from .user_css import UserCSS
 | 
			
		||||
from .administrators import Administrators, get_administrators_list
 | 
			
		||||
from .titan_tokens import TitanTokens, get_titan_token
 | 
			
		||||
from .token_transactions import TokenTransactions
 | 
			
		||||
from .patreon import Patreon
 | 
			
		||||
 | 
			
		||||
def set_titan_token(user_id, amt_change, action):
 | 
			
		||||
    token_count = get_titan_token(user_id)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								webapp/titanembeds/database/patreon.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								webapp/titanembeds/database/patreon.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
from titanembeds.database import db
 | 
			
		||||
 | 
			
		||||
class Patreon(db.Model):
 | 
			
		||||
    __tablename__ = "patreon"
 | 
			
		||||
    id = db.Column(db.Integer, primary_key=True)
 | 
			
		||||
    user_id = db.Column(db.String(255), nullable=False) # User ID from patreon
 | 
			
		||||
    total_synced = db.Column(db.Integer, nullable=False) # Total cents synced on our end
 | 
			
		||||
    
 | 
			
		||||
    def __init__(self, user_id, total_synced=0):
 | 
			
		||||
        self.user_id = user_id
 | 
			
		||||
        self.total_synced = total_synced
 | 
			
		||||
    
 | 
			
		||||
    def __repr__(self):
 | 
			
		||||
        return '<Patreon {0} {1} {2}>'.format(self.id, self.user_id, self.total_synced)
 | 
			
		||||
		Reference in New Issue
	
	Block a user