mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-06-16 11:25:22 +02:00
Display rich embed support
This commit is contained in:
@ -62,7 +62,8 @@ class DatabaseInterface(object):
|
||||
str(message.timestamp),
|
||||
edit_ts,
|
||||
json.dumps(get_message_mentions(message.mentions)),
|
||||
json.dumps(message.attachments)
|
||||
json.dumps(message.attachments),
|
||||
json.dumps(message.embeds)
|
||||
)
|
||||
session.add(msg)
|
||||
session.commit()
|
||||
@ -81,6 +82,7 @@ class DatabaseInterface(object):
|
||||
msg.edited_timestamp = message.edited_timestamp
|
||||
msg.mentions = json.dumps(get_message_mentions(message.mentions))
|
||||
msg.attachments = json.dumps(message.attachments)
|
||||
msg.embeds = json.dumps(message.embeds)
|
||||
msg.author = json.dumps(get_message_author(message))
|
||||
session.commit()
|
||||
|
||||
|
@ -12,8 +12,9 @@ class Messages(Base):
|
||||
edited_timestamp = db.Column(db.TIMESTAMP) # Timestamp of when content is edited
|
||||
mentions = db.Column(db.Text()) # Mentions serialized
|
||||
attachments = db.Column(db.Text()) # serialized attachments
|
||||
embeds = db.Column(db.Text().with_variant(db.Text(length=4294967295), 'mysql')) # message embeds
|
||||
|
||||
def __init__(self, guild_id, channel_id, message_id, content, author, timestamp, edited_timestamp, mentions, attachments):
|
||||
def __init__(self, guild_id, channel_id, message_id, content, author, timestamp, edited_timestamp, mentions, attachments, embeds):
|
||||
self.guild_id = guild_id
|
||||
self.channel_id = channel_id
|
||||
self.message_id = message_id
|
||||
@ -23,6 +24,7 @@ class Messages(Base):
|
||||
self.edited_timestamp = edited_timestamp
|
||||
self.mentions = mentions
|
||||
self.attachments = attachments
|
||||
self.embeds = embeds
|
||||
|
||||
def __repr__(self):
|
||||
return '<Messages {0} {1} {2} {3} {4}>'.format(self.id, self.guild_id, self.guild_id, self.channel_id, self.message_id)
|
||||
|
@ -26,6 +26,7 @@ class SocketIOInterface:
|
||||
"edited_timestamp": edit_ts,
|
||||
"mentions": get_message_mentions(message.mentions),
|
||||
"attachments": message.attachments,
|
||||
"embeds": message.embeds,
|
||||
}
|
||||
nickname = None
|
||||
if hasattr(message.author, 'nick') and message.author.nick:
|
||||
|
Reference in New Issue
Block a user