mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
Update createCase.ts
This commit is contained in:
parent
59a597739e
commit
05df7646ba
1 changed files with 4 additions and 1 deletions
|
@ -44,7 +44,10 @@ export async function createCase(pluginData: GuildPluginData<CasesPluginType>, a
|
||||||
is_hidden: Boolean(args.hide),
|
is_hidden: Boolean(args.hide),
|
||||||
});
|
});
|
||||||
if (!casesTypesWithoutArchive.includes(args.type)) {
|
if (!casesTypesWithoutArchive.includes(args.type)) {
|
||||||
const messagesToArchive = await pluginData.state.savedMessages.getUserMessages(user.id, 50);
|
const messagesToArchive = Array.from(await pluginData.state.savedMessages.getUserMessages(user.id, 50)).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);
|
||||||
await createCaseNote(pluginData, {
|
await createCaseNote(pluginData, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue