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-06-09 06:22:33 +02:00
|
|
|
visitor_view = db.Column(db.Boolean()) # If users are automatically "signed in" and can view chat
|
2017-08-27 23:41:36 +02:00
|
|
|
webhook_messages = db.Column(db.Boolean()) # Use webhooks to send messages instead of the bot
|
2017-09-24 03:22:07 +02:00
|
|
|
guest_icon = db.Column(db.String(255), default=None) # Guest icon url, None if unset
|
2017-05-09 02:55:07 +02:00
|
|
|
chat_links = db.Column(db.Boolean()) # If users can post links
|
|
|
|
bracket_links = db.Column(db.Boolean()) # If appending brackets to links to prevent embed
|
2017-11-04 03:58:26 +01:00
|
|
|
unauth_captcha = db.Column(db.Boolean(), nullable=False, server_default="1") # Enforce captcha on guest users
|
2017-05-09 02:55:07 +02:00
|
|
|
mentions_limit = db.Column(db.Integer) # If there is a limit on the number of mentions in a msg
|
2017-09-05 08:54:54 +02:00
|
|
|
roles = db.Column(db.Text().with_variant(db.Text(length=4294967295), 'mysql')) # Guild Roles
|
|
|
|
channels = db.Column(db.Text().with_variant(db.Text(length=4294967295), 'mysql'))# Guild channels
|
|
|
|
webhooks = db.Column(db.Text().with_variant(db.Text(length=4294967295), 'mysql'))# Guild webhooks
|
|
|
|
emojis = db.Column(db.Text().with_variant(db.Text(length=4294967295), 'mysql')) # Guild Emojis
|
2017-05-07 00:27:07 +02:00
|
|
|
owner_id = db.Column(db.String(255)) # Snowflake of the owner
|
|
|
|
icon = db.Column(db.String(255)) # The icon string, null if none
|
2018-01-13 19:37:42 +01:00
|
|
|
invite_link = db.Column(db.String(255)) # Custom Discord Invite Link
|
2017-05-04 05:22:27 +02:00
|
|
|
|
2017-07-01 08:52:21 +02:00
|
|
|
def __init__(self, guild_id, name, roles, channels, webhooks, emojis, 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-06-09 06:22:33 +02:00
|
|
|
self.visitor_view = False
|
2017-08-27 23:41:36 +02:00
|
|
|
self.webhook_messages = False
|
2017-09-24 03:22:07 +02:00
|
|
|
self.guest_icon = None
|
2017-05-09 02:55:07 +02:00
|
|
|
self.chat_links = True
|
|
|
|
self.bracket_links = True
|
2017-11-04 03:58:26 +01:00
|
|
|
self.unauth_captcha = True
|
2017-05-09 02:55:07 +02:00
|
|
|
self.mentions_limit = -1 # -1 = unlimited mentions
|
2017-05-07 00:27:07 +02:00
|
|
|
self.roles = roles
|
|
|
|
self.channels = channels
|
2017-07-01 08:52:21 +02:00
|
|
|
self.webhooks = webhooks
|
2017-05-30 00:07:32 +02:00
|
|
|
self.emojis = emojis
|
2017-05-07 00:27:07 +02:00
|
|
|
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)
|