From c6444868763fd94cb5a9f34dea569f67a1e73a14 Mon Sep 17 00:00:00 2001 From: amy Date: Tue, 26 Nov 2024 01:02:14 +0330 Subject: [PATCH] add multiple channel support --- config.example.json | 2 +- src/main.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config.example.json b/config.example.json index c56b7a8..39501b9 100644 --- a/config.example.json +++ b/config.example.json @@ -1,7 +1,7 @@ { "groq-key": "", "discord-key": "", - "chat-channelID": "", + "chat-channelID": [""], "should-send-debug": false, "debug-channelID": "" } \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 30122bf..581cd8f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,7 +60,7 @@ client.on(Events.MessageCreate, (message: Message) => { } } - if (message.channel.id !== conf['chat-channelID']) return + if (!conf['chat-channelID'].includes(message.channel.id)) return (async function () { let imageexplain: string | boolean = ""; @@ -78,8 +78,6 @@ client.on(Events.MessageCreate, (message: Message) => { } } - // Log the result after the asynchronous operations are complete - console.log(imageexplain); messages.push({ "role": "user", "name": message.author.username,