Update events.ts

This commit is contained in:
Corey Johnson 2025-07-16 10:59:00 -07:00
parent 17b7ab3a9d
commit 258dd43e35

View File

@ -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) {