feat: add web search, stagger responses
Node.js CI / Lint and Test (push) Successful in 39s

This commit is contained in:
2025-10-10 17:53:36 -07:00
parent 94a4d7e043
commit 4300cf0d3f
6 changed files with 180 additions and 70 deletions
+27
View File
@@ -0,0 +1,27 @@
/* eslint-disable no-await-in-loop -- This is necessary so we can send the responses sequentially.*/
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { sleep } from "../utils/sleep.js";
import type { DMChannel, GuildTextBasedChannel, Message } from "discord.js";
/**
* Sends an AI response to a channel.
* @param content - The content to send.
* @param send - The send or reply function to use.
* @param type - The sendTyping function to use.
*/
export const sendAiResponse = async(
content: Array<string>,
send: GuildTextBasedChannel["send"] | DMChannel["send"] | Message["reply"],
type: GuildTextBasedChannel["sendTyping"],
): Promise<void> => {
for (const line of content) {
await send(line);
await type();
await sleep(2500);
}
};