generated from nhcarrigan/template
This commit is contained in:
@@ -20,11 +20,11 @@ export const sendAiResponse = async(
|
|||||||
type: GuildTextBasedChannel["sendTyping"],
|
type: GuildTextBasedChannel["sendTyping"],
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const joined = content.join("\n\n");
|
const joined = content.join("\n\n");
|
||||||
if (joined.length < 4000) {
|
if (joined.length < 2000) {
|
||||||
await send(joined);
|
await send(joined);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const chunks = joined.match(/[\S\s]{1,4000}/g);
|
const chunks = joined.match(/[\S\s]{1,2000}/g);
|
||||||
if (chunks) {
|
if (chunks) {
|
||||||
for (const chunk of chunks) {
|
for (const chunk of chunks) {
|
||||||
await send(chunk);
|
await send(chunk);
|
||||||
|
|||||||
Reference in New Issue
Block a user