From 2277e44588be3899a37dbff12397fdc54ebdc583 Mon Sep 17 00:00:00 2001 From: srqc <98553181+2srqc@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:55:16 -0500 Subject: [PATCH] Update ArchiveCmd.ts --- backend/src/plugins/Utility/commands/ArchiveCmd.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/plugins/Utility/commands/ArchiveCmd.ts b/backend/src/plugins/Utility/commands/ArchiveCmd.ts index a21f6c69..b77f708b 100644 --- a/backend/src/plugins/Utility/commands/ArchiveCmd.ts +++ b/backend/src/plugins/Utility/commands/ArchiveCmd.ts @@ -11,6 +11,7 @@ export async function archiveMessages( pluginData: GuildPluginData, messagesToArchive: SavedMessage[], ) { + messagesToArchive = Array.from(messagesToArchive).sort((a, b) => (a.posted_at > b.posted_at ? 1 : -1)); const archiveId = await pluginData.state.archives.createFromSavedMessages(messagesToArchive, pluginData.guild); const baseUrl = getBaseUrl(pluginData);