3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 10:25:01 +00:00

Update ArchiveCmd.ts

This commit is contained in:
srqc 2023-02-09 19:55:16 -05:00 committed by GitHub
parent 5ccc0f4cfc
commit 2277e44588
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ export async function archiveMessages(
pluginData: GuildPluginData<UtilityPluginType>, pluginData: GuildPluginData<UtilityPluginType>,
messagesToArchive: SavedMessage[], 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 archiveId = await pluginData.state.archives.createFromSavedMessages(messagesToArchive, pluginData.guild);
const baseUrl = getBaseUrl(pluginData); const baseUrl = getBaseUrl(pluginData);