2017-05-04 05:22:27 +02:00
|
|
|
from titanembeds.database import db, Base
|
|
|
|
|
|
|
|
class Guilds(Base):
|
|
|
|
__tablename__ = "guilds"
|
|
|
|
id = db.Column(db.Integer, primary_key=True) # Auto incremented id
|
|
|
|
guild_id = db.Column(db.String(255)) # Discord guild id
|
2017-05-07 00:27:07 +02:00
|
|
|
name = db.Column(db.String(255)) # Name
|
2017-05-04 05:22:27 +02:00
|
|
|
unauth_users = db.Column(db.Boolean()) # If allowed unauth users
|
2017-05-07 00:27:07 +02:00
|
|
|
roles = db.Column(db.Text()) # Guild Roles
|
|
|
|
channels = db.Column(db.Text()) # Guild channels
|
|
|
|
owner_id = db.Column(db.String(255)) # Snowflake of the owner
|
|
|
|
icon = db.Column(db.String(255)) # The icon string, null if none
|
2017-05-04 05:22:27 +02:00
|
|
|
|
2017-05-07 00:27:07 +02:00
|
|
|
def __init__(self, guild_id, name, roles, channels, owner_id, icon):
|
2017-05-04 05:22:27 +02:00
|
|
|
self.guild_id = guild_id
|
2017-05-07 00:27:07 +02:00
|
|
|
self.name = name
|
2017-05-04 05:22:27 +02:00
|
|
|
self.unauth_users = True # defaults to true
|
2017-05-07 00:27:07 +02:00
|
|
|
self.roles = roles
|
|
|
|
self.channels = channels
|
|
|
|
self.owner_id = owner_id
|
|
|
|
self.icon = icon
|
2017-05-04 05:22:27 +02:00
|
|
|
|
|
|
|
def __repr__(self):
|
2017-05-07 00:27:07 +02:00
|
|
|
return '<Guilds {0} {1}>'.format(self.id, self.guild_id)
|