diff --git a/default.env b/default.env index 0e0f957..c1442e4 100644 --- a/default.env +++ b/default.env @@ -1,5 +1,4 @@ THE_TOKEN = "DISCORD_TOKEN_HERE" -CHANNEL_ID = CHANNEL_ID_HERE -CHANNEL_ID_2 = CHANNEL_ID_HERE +CHANNEL_IDS = 1094494101631680653,1094628334727614605 ROOT_IP = 192.168.0.15 ROOT_PORT = 8000 \ No newline at end of file diff --git a/llamabot.js b/llamabot.js index ac5706b..177d53b 100644 --- a/llamabot.js +++ b/llamabot.js @@ -24,8 +24,8 @@ const client = new Client({ partials: [Partials.Channel], }); -const channelID = '1094494101631680653'; // Replace with your channel ID -const channelID2 = '1094628334727614605'; // Replace with your channel ID +// Grab ChannelIDs from the .env file +const channelIDs = process.env.CHANNEL_IDS.split(','); const conversations = new Map(); @@ -88,9 +88,10 @@ client.on('messageCreate', async (message) => { } // Only respond in the specified channels - if (message.channel.id !== channelID && message.channel.id !== channelID2) { - return; + if (!channelIDs.includes(message.channel.id)) { + return; } + if (message.author.bot) return; // Ignore messages from bots // Check if any conversation is busy @@ -110,11 +111,11 @@ client.on('messageCreate', async (message) => { if (conversation.messages.length === 0) { conversation.messages.push({ role: 'user', - content: `You are rAi, the most helpful writing AI, you code and write without any mistakes.` + content: `You are rAi, the most helpful writing AI, you code, write and provide information without any mistakes.` }); conversation.messages.push({ role: 'user', - content: `My name is ${message.author.username}.` + content: `My name is ${message.author.username}. \nIf you address me, tag me using @${message.author.username}` }); conversation.messages.push({ role: 'assistant',