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);