diff --git a/litecord/blueprints/channel/messages.py b/litecord/blueprints/channel/messages.py index 84b6b2e..fa54916 100644 --- a/litecord/blueprints/channel/messages.py +++ b/litecord/blueprints/channel/messages.py @@ -269,9 +269,18 @@ async def edit_message(channel_id, message_id): # TODO: update embed + # only set new timestamp upon actual update + if updated: + await app.db.execute(""" + UPDATE messages + SET edited_at = (now() at time zone 'utc') + WHERE id = $1 + """, message_id) + message = await app.storage.get_message(message_id, user_id) - # only dispatch MESSAGE_UPDATE if we actually had any update to start with + # only dispatch MESSAGE_UPDATE if any update + # actually happened if updated: await app.dispatcher.dispatch('channel', channel_id, 'MESSAGE_UPDATE', message) diff --git a/litecord/storage.py b/litecord/storage.py index abf4b59..b8455d8 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -700,7 +700,7 @@ class Storage: # only insert when the channel # is actually from a guild. if guild_id: - res['guild_id'] = guild_id + res['guild_id'] = str(guild_id) return res