From 258dd43e3562aff227968d9e73ca555c49d6263a Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 16 Jul 2025 10:59:00 -0700 Subject: [PATCH] Update events.ts --- packages/spike/src/discord/events.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/spike/src/discord/events.ts b/packages/spike/src/discord/events.ts index e10ba62..52322b0 100644 --- a/packages/spike/src/discord/events.ts +++ b/packages/spike/src/discord/events.ts @@ -11,7 +11,14 @@ export const listenForEvents = (client: Client) => { if (!msg.guild || msg.mentions.has(client.user!)) { const response = await respondToUserMessage(msg) if (response) { - await msg.channel.send(response) + if (response.length > 2000) { + const chunks = response.match(/.{1,2000}/g) || [] // Discord has a 2000 character limit, so we need to split the response + for (const chunk of chunks) { + await msg.channel.send(chunk) + } + } else { + await msg.channel.send(response) + } } } } catch (error) {