From 9694a2fd4c548924f49e981c97e09a57333327e7 Mon Sep 17 00:00:00 2001 From: holzmaster Date: Sun, 14 Jul 2024 14:11:14 +0200 Subject: [PATCH] Align chunking --- src/commands/gibmirids.ts | 8 +++++--- src/commands/hilfe.ts | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/gibmirids.ts b/src/commands/gibmirids.ts index 625fe5da..412761bb 100644 --- a/src/commands/gibmirids.ts +++ b/src/commands/gibmirids.ts @@ -55,10 +55,12 @@ export default class GibMirIdsCommand implements MessageCommand { ); lines.push(...roles.map(r => `- ${r.name}: \`${r.id}\``)); - for (const chunk of chunking.splitInChunks(lines, {})) { - await message.author.send(chunk); - } + const chunks = chunking.splitInChunks(lines, { + chunkOpeningLine: "```css", + chunkClosingLine: "```", + }); + await Promise.all(chunks.map(chunk => message.author.send(chunk))); await message.react("⚙️"); } } diff --git a/src/commands/hilfe.ts b/src/commands/hilfe.ts index 40472e99..b234d2bc 100644 --- a/src/commands/hilfe.ts +++ b/src/commands/hilfe.ts @@ -37,7 +37,6 @@ export default class HilfeCommand implements MessageCommand { } const chunks = chunking.splitInChunks(lines, { - charLimitPerChunk: 2000, chunkOpeningLine: "```css", chunkClosingLine: "```", });