Prevent update msg when no message exists

This commit is contained in:
Jeremy Zhang 2017-05-06 01:04:34 -07:00
parent ba7b47f193
commit b43d29bca5

View File

@ -68,6 +68,7 @@ class DatabaseInterface(object):
.filter(Messages.guild_id == message.server.id) \ .filter(Messages.guild_id == message.server.id) \
.filter(Messages.channel_id == message.channel.id) \ .filter(Messages.channel_id == message.channel.id) \
.filter(Messages.message_id == message.id).first() .filter(Messages.message_id == message.id).first()
if msg:
msg.content = message.content msg.content = message.content
msg.edited_timestamp = message.edited_timestamp msg.edited_timestamp = message.edited_timestamp
msg.mentions = json.dumps(message.mentions) msg.mentions = json.dumps(message.mentions)