2017-05-22 03:07:32 +02:00
|
|
|
from titanembeds.database import db
|
|
|
|
|
|
|
|
class Cosmetics(db.Model):
|
|
|
|
__tablename__ = "cosmetics"
|
2017-06-04 07:05:55 +02:00
|
|
|
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 of cosmetics
|
2017-07-22 04:06:45 +02:00
|
|
|
css = db.Column(db.Boolean(), nullable=False) # If they can create/edit custom CSS
|
2017-09-11 09:52:13 +02:00
|
|
|
css_limit = db.Column(db.Integer, nullable=False, server_default="0") # Custom CSS Limit
|
2017-09-24 03:22:07 +02:00
|
|
|
guest_icon = db.Column(db.Boolean(), nullable=False, server_default=db.false()) # If they can set the guest icon for all guilds
|
2017-07-22 04:06:45 +02:00
|
|
|
|
|
|
|
def __init__(self, user_id, **kwargs):
|
|
|
|
self.user_id = user_id
|
|
|
|
|
|
|
|
if "css" in kwargs:
|
|
|
|
self.css = kwargs["css"]
|
2017-07-22 07:02:59 +02:00
|
|
|
else:
|
|
|
|
self.css = False
|
2017-09-11 09:52:13 +02:00
|
|
|
|
|
|
|
if "css_limit" in kwargs:
|
|
|
|
self.css_limit = kwargs["css_limit"]
|
|
|
|
else:
|
|
|
|
self.css_limit = 0
|
2017-09-13 07:55:51 +02:00
|
|
|
|
2017-09-24 03:22:07 +02:00
|
|
|
if "guest_icon" in kwargs:
|
|
|
|
self.guest_icon = kwargs["guest_icon"]
|
2017-09-13 07:55:51 +02:00
|
|
|
else:
|
2017-09-24 03:22:07 +02:00
|
|
|
self.guest_icon = False
|