From 1973b1d3ae429e756f20367bb71701d739496d0a Mon Sep 17 00:00:00 2001 From: Kevin Dang <77701718+kevinthedang@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:47:08 -0700 Subject: [PATCH] Public/Private Chat Threads (#62) * add: validate thread creation in ollama channel * rm: channel_id variable * add: short notes for threads * update: openFile to openConfig for clarity * update: test ci runs on master * add: notes for work * add: basic chat storing via json * update: stores entire msgHist according to capacity * add: removes json file if thread is deleted * add: chats with independent histories * add: private vs public threads * update: validate threads made by ollama for chats * update: cleanup and version increment --- .env.sample | 3 -- .github/workflows/build.yml | 2 - .github/workflows/test.yml | 4 +- docker-compose.yml | 5 +- package-lock.json | 10 ++-- package.json | 2 +- src/commands/capacity.ts | 6 +-- src/commands/disable.ts | 4 +- src/commands/index.ts | 2 + src/commands/messageStream.ts | 6 +-- src/commands/messageStyle.ts | 6 +-- src/commands/threadCreate.ts | 14 ++++-- src/commands/threadPrivateCreate.ts | 34 +++++++++++++ src/events/index.ts | 4 +- src/events/messageCreate.ts | 34 ++++++++++--- src/events/threadDelete.ts | 20 ++++++++ src/keys.ts | 1 - src/queues/queue.ts | 10 +++- src/utils/events.ts | 1 - src/utils/jsonHandler.ts | 78 +++++++++++++++++++++++++++-- src/utils/messageEmbed.ts | 1 - src/utils/messageNormal.ts | 1 - 22 files changed, 199 insertions(+), 49 deletions(-) create mode 100644 src/commands/threadPrivateCreate.ts create mode 100644 src/events/threadDelete.ts diff --git a/.env.sample b/.env.sample index 418fa97..b81c1cf 100644 --- a/.env.sample +++ b/.env.sample @@ -4,9 +4,6 @@ CLIENT_TOKEN = BOT_TOKEN # id token of a discord server GUILD_ID = GUILD_ID -# Channel where the bot listens to messages -CHANNEL_ID = CHANNEL_ID - # model for the bot to query from (i.e. llama2 [llama2:13b], mistral, codellama, etc... ) MODEL = MODEL_NAME diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b1c890..89e6a19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,6 @@ jobs: touch .env echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env echo GUILD_ID = ${{ secrets.GUILD_ID }} >> .env - echo CHANNEL_ID = ${{ secrets.CHANNEL_ID }} >> .env echo MODEL = ${{ secrets.MODEL }} >> .env echo CLIENT_UID = ${{ secrets.CLIENT_UID }} >> .env echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env @@ -62,7 +61,6 @@ jobs: touch .env echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env echo GUILD_ID = ${{ secrets.GUILD_ID }} >> .env - echo CHANNEL_ID = ${{ secrets.CHANNEL_ID }} >> .env echo MODEL = ${{ secrets.MODEL }} >> .env echo CLIENT_UID = ${{ secrets.CLIENT_UID }} >> .env echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c16dcd5..5205402 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ run-name: Test source code for errors on: push: branches: - - unit-testing + - master jobs: Discord-Node-Test: @@ -28,7 +28,6 @@ jobs: touch .env echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env echo GUILD_ID = ${{ secrets.GUILD_ID }} >> .env - echo CHANNEL_ID = ${{ secrets.CHANNEL_ID }} >> .env echo MODEL = ${{ secrets.MODEL }} >> .env echo CLIENT_UID = ${{ secrets.CLIENT_UID }} >> .env echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env @@ -56,7 +55,6 @@ jobs: touch .env echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env echo GUILD_ID = ${{ secrets.GUILD_ID }} >> .env - echo CHANNEL_ID = ${{ secrets.CHANNEL_ID }} >> .env echo MODEL = ${{ secrets.MODEL }} >> .env echo CLIENT_UID = ${{ secrets.CLIENT_UID }} >> .env echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env diff --git a/docker-compose.yml b/docker-compose.yml index 173bbdd..8af38a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,11 +8,10 @@ services: build: ./ # find docker file in designated path container_name: discord restart: always # rebuild container always - image: discord/bot:0.4.4 + image: discord/bot:0.5.0 environment: CLIENT_TOKEN: ${CLIENT_TOKEN} GUILD_ID: ${GUILD_ID} - CHANNEL_ID: ${CHANNEL_ID} MODEL: ${MODEL} CLIENT_UID: ${CLIENT_UID} OLLAMA_IP: ${OLLAMA_IP} @@ -40,6 +39,8 @@ services: ports: - ${OLLAMA_PORT}:${OLLAMA_PORT} +# Put Redis Container here? + # create a network that supports giving addresses withing a specific subnet networks: ollama-net: diff --git a/package-lock.json b/package-lock.json index 44f06de..e294e2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord-ollama", - "version": "0.4.4", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "discord-ollama", - "version": "0.4.4", + "version": "0.5.0", "license": "ISC", "dependencies": { "discord.js": "^14.14.1", @@ -1980,9 +1980,9 @@ } }, "node_modules/ollama": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/ollama/-/ollama-0.5.0.tgz", - "integrity": "sha512-CRtRzsho210EGdK52GrUMohA2pU+7NbgEaBG3DcYeRmvQthDO7E2LHOkLlUUeaYUlNmEd8icbjC02ug9meSYnw==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ollama/-/ollama-0.5.1.tgz", + "integrity": "sha512-mAiCHxdvu63E8EFopz0y82QG7rGfYmKAWgmjG2C7soiRuz/Sj3r/ebvCOp+jasiCubqUPE0ZThKT5LR6wrrPtA==", "dependencies": { "whatwg-fetch": "^3.6.20" } diff --git a/package.json b/package.json index f91fcb6..8fb10b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-ollama", - "version": "0.4.4", + "version": "0.5.0", "description": "Ollama Integration into discord", "main": "build/index.js", "exports": "./build/index.js", diff --git a/src/commands/capacity.ts b/src/commands/capacity.ts index ba79c6f..a512fec 100644 --- a/src/commands/capacity.ts +++ b/src/commands/capacity.ts @@ -1,6 +1,6 @@ import { ChannelType, Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js' import { SlashCommand } from '../utils/commands.js' -import { openFile } from '../utils/jsonHandler.js' +import { openConfig } from '../utils/jsonHandler.js' export const Capacity: SlashCommand = { name: 'modify-capacity', @@ -20,10 +20,10 @@ export const Capacity: SlashCommand = { run: async (client: Client, interaction: CommandInteraction) => { // fetch channel and message const channel = await client.channels.fetch(interaction.channelId) - if (!channel || channel.type !== ChannelType.GuildText) return + if (!channel || channel.type !== ChannelType.PublicThread) return // set state of bot chat features - openFile('config.json', interaction.commandName, interaction.options.get('context-capacity')?.value) + openConfig('config.json', interaction.commandName, interaction.options.get('context-capacity')?.value) interaction.reply({ content: `Message History Capacity has been set to \`${interaction.options.get('context-capacity')?.value}\``, diff --git a/src/commands/disable.ts b/src/commands/disable.ts index 70d5c47..d0dfa55 100644 --- a/src/commands/disable.ts +++ b/src/commands/disable.ts @@ -1,6 +1,6 @@ import { ChannelType, Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js' import { SlashCommand } from '../utils/commands.js' -import { openFile } from '../utils/jsonHandler.js' +import { openConfig } from '../utils/jsonHandler.js' export const Disable: SlashCommand = { name: 'toggle-chat', @@ -32,7 +32,7 @@ export const Disable: SlashCommand = { } // set state of bot chat features - openFile('config.json', interaction.commandName, interaction.options.get('enabled')?.value) + openConfig('config.json', interaction.commandName, interaction.options.get('enabled')?.value) interaction.reply({ content: `Chat features has been \`${interaction.options.get('enabled')?.value ? "enabled" : "disabled" }\``, diff --git a/src/commands/index.ts b/src/commands/index.ts index 55a2990..0722371 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -5,9 +5,11 @@ import { MessageStream } from './messageStream.js' import { Disable } from './disable.js' import { Shutoff } from './shutoff.js' import { Capacity } from './capacity.js' +import { PrivateThreadCreate } from './threadPrivateCreate.js' export default [ ThreadCreate, + PrivateThreadCreate, MessageStyle, MessageStream, Disable, diff --git a/src/commands/messageStream.ts b/src/commands/messageStream.ts index 4e1965d..95d408d 100644 --- a/src/commands/messageStream.ts +++ b/src/commands/messageStream.ts @@ -1,6 +1,6 @@ import { ApplicationCommandOptionType, ChannelType, Client, CommandInteraction } from 'discord.js' import { SlashCommand } from '../utils/commands.js' -import { openFile } from '../utils/jsonHandler.js' +import { openConfig } from '../utils/jsonHandler.js' export const MessageStream: SlashCommand = { name: 'message-stream', @@ -20,10 +20,10 @@ export const MessageStream: SlashCommand = { run: async (client: Client, interaction: CommandInteraction) => { // verify channel const channel = await client.channels.fetch(interaction.channelId) - if (!channel || channel.type !== ChannelType.GuildText) return + if (!channel || channel.type !== ChannelType.PublicThread) return // save value to json and write to it - openFile('config.json', interaction.commandName, interaction.options.get('stream')?.value) + openConfig('config.json', interaction.commandName, interaction.options.get('stream')?.value) interaction.reply({ content: `Message streaming preferences for embed set to: \`${interaction.options.get('stream')?.value}\``, diff --git a/src/commands/messageStyle.ts b/src/commands/messageStyle.ts index 023fae8..92fcb76 100644 --- a/src/commands/messageStyle.ts +++ b/src/commands/messageStyle.ts @@ -1,6 +1,6 @@ import { ChannelType, Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js' import { SlashCommand } from '../utils/commands.js' -import { openFile } from '../utils/jsonHandler.js' +import { openConfig } from '../utils/jsonHandler.js' export const MessageStyle: SlashCommand = { name: 'message-style', @@ -20,10 +20,10 @@ export const MessageStyle: SlashCommand = { run: async (client: Client, interaction: CommandInteraction) => { // fetch channel and message const channel = await client.channels.fetch(interaction.channelId) - if (!channel || channel.type !== ChannelType.GuildText) return + if (!channel || channel.type !== ChannelType.PublicThread) return // set the message style - openFile('config.json', interaction.commandName, interaction.options.get('embed')?.value) + openConfig('config.json', interaction.commandName, interaction.options.get('embed')?.value) interaction.reply({ content: `Message style preferences for embed set to: \`${interaction.options.get('embed')?.value}\``, diff --git a/src/commands/threadCreate.ts b/src/commands/threadCreate.ts index ce67a6a..b87f65c 100644 --- a/src/commands/threadCreate.ts +++ b/src/commands/threadCreate.ts @@ -1,5 +1,6 @@ import { ChannelType, Client, CommandInteraction, TextChannel } from 'discord.js' import { SlashCommand } from '../utils/commands.js' +import { openThreadInfo } from '../utils/jsonHandler.js' export const ThreadCreate: SlashCommand = { name: 'thread', @@ -12,16 +13,21 @@ export const ThreadCreate: SlashCommand = { if (!channel || channel.type !== ChannelType.GuildText) return const thread = await (channel as TextChannel).threads.create({ - name: `support-${Date.now()}`, - reason: `Support ticket ${Date.now()}` + name: `${client.user?.username}-support-${Date.now()}`, + reason: `Support ticket ${Date.now()}`, + type: ChannelType.PublicThread }) // Send a message in the thread - thread.send(`**User:** ${interaction.user} \n**People in Coversation:** ${thread.memberCount}`) + thread.send(`Hello ${interaction.user} and others! \n\nIt's nice to meet you. Please talk to me by typing **@${client.user?.username}** with your prompt.`) + + // handle storing this chat channel + // store: thread.id, thread.name + openThreadInfo(`${thread.id}.json`, thread) // user only reply return interaction.reply({ - content: `I can help you in the Thread below. \n**Thread ID:** ${thread.id}`, + content: `I can help you in thread **${thread.id}** below.`, ephemeral: true }) } diff --git a/src/commands/threadPrivateCreate.ts b/src/commands/threadPrivateCreate.ts new file mode 100644 index 0000000..6ebd2ef --- /dev/null +++ b/src/commands/threadPrivateCreate.ts @@ -0,0 +1,34 @@ +import { ChannelType, Client, CommandInteraction, TextChannel } from 'discord.js' +import { SlashCommand } from '../utils/commands.js' +import { openThreadInfo } from '../utils/jsonHandler.js' + +export const PrivateThreadCreate: SlashCommand = { + name: 'private-thread', + description: 'creates a private thread and mentions user', + + // Query for server information + run: async (client: Client, interaction: CommandInteraction) => { + // fetch the channel + const channel = await client.channels.fetch(interaction.channelId) + if (!channel || channel.type !== ChannelType.GuildText) return + + const thread = await (channel as TextChannel).threads.create({ + name: `${client.user?.username}-private-support-${Date.now()}`, + reason: `Support ticket ${Date.now()}`, + type: ChannelType.PrivateThread + }) + + // Send a message in the thread + thread.send(`Hello ${interaction.user}! \n\nIt's nice to meet you. Please talk to me by typing @${client.user?.username} with your prompt.`) + + // handle storing this chat channel + // store: thread.id, thread.name + openThreadInfo(`${thread.id}.json`, thread) + + // user only reply + return interaction.reply({ + content: `I can help you in thread **${thread.id}**. Please refer to the private channel below this one.`, + ephemeral: true + }) + } +} \ No newline at end of file diff --git a/src/events/index.ts b/src/events/index.ts index 2012e25..4da6de0 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -2,10 +2,12 @@ import { Event } from '../utils/index.js' import interactionCreate from './interactionCreate.js' import messageCreate from './messageCreate.js' import ready from './ready.js' +import threadDelete from './threadDelete.js' // Centralized export for all events export default [ ready, messageCreate, - interactionCreate + interactionCreate, + threadDelete ] as Event[] // staticly is better ts practice, dynamic exporting is possible \ No newline at end of file diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 3ed6877..41ce5ce 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -1,17 +1,25 @@ -import { ChatResponse } from 'ollama' -import { embedMessage, event, Events, normalMessage } from '../utils/index.js' -import { Configuration, getConfig, openFile } from '../utils/jsonHandler.js' +import { embedMessage, event, Events, normalMessage, UserMessage } from '../utils/index.js' +import { Configuration, getConfig, getThread, openConfig, openThreadInfo } from '../utils/jsonHandler.js' import { clean } from '../utils/mentionClean.js' +import { ThreadChannel } from 'discord.js' /** * Max Message length for free users is 2000 characters (bot or not). * @param message the message received from the channel */ -export default event(Events.MessageCreate, async ({ log, msgHist, tokens, ollama }, message) => { +export default event(Events.MessageCreate, async ({ log, msgHist, tokens, ollama, client }, message) => { log(`Message \"${clean(message.content)}\" from ${message.author.tag} in channel/thread ${message.channelId}.`) - // Hard-coded channel to test output there only, in our case "ollama-endpoint" - if (message.channelId != tokens.channel) return + // need new check for "open/active" threads here! + const threadMessages: UserMessage[] = await new Promise((resolve) => { + // set new queue to modify + getThread(`${message.channelId}.json`, (threadInfo) => { + if (threadInfo?.messages) + resolve(threadInfo.messages) + else + log(`Channel/Thread ${message.channelId} does not exist.`) + }) + }) // Do not respond if bot talks in the chat if (message.author.tag === message.client.user.tag) return @@ -54,7 +62,11 @@ export default event(Events.MessageCreate, async ({ log, msgHist, tokens, ollama }) }) - let response: string + // response string for ollama to put its response + let response: string + + // set up new queue + msgHist.setQueue(threadMessages) // check if we can push, if not, remove oldest while (msgHist.size() >= msgHist.capacity) msgHist.dequeue() @@ -82,9 +94,15 @@ export default event(Events.MessageCreate, async ({ log, msgHist, tokens, ollama role: 'assistant', content: response }) + + // only update the json on success + openThreadInfo(`${message.channelId}.json`, + client.channels.fetch(message.channelId) as unknown as ThreadChannel, + msgHist.getItems() + ) } catch (error: any) { msgHist.pop() // remove message because of failure - openFile('config.json', 'message-style', false) + openConfig('config.json', 'message-style', false) message.reply(`**Error Occurred:**\n\n**Reason:** *${error.message}*`) } }) \ No newline at end of file diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts new file mode 100644 index 0000000..ee9017d --- /dev/null +++ b/src/events/threadDelete.ts @@ -0,0 +1,20 @@ +import { ThreadChannel } from 'discord.js' +import { event, Events } from '../utils/index.js' +import fs from 'fs' + +/** + * Event to remove the associated .json file for a thread once deleted + */ +export default event(Events.ThreadDelete, ({ log }, thread: ThreadChannel) => { + const filePath = `data/${thread.id}.json` + if (fs.existsSync(filePath)) { + fs.unlink(filePath, (error) => { + if (error) + log(`Error deleting file ${filePath}`, error) + else + log(`Successfully deleted ${filePath} thread info`) + }) + } else { + log(`File ${filePath} does not exist.`) + } +}) \ No newline at end of file diff --git a/src/keys.ts b/src/keys.ts index 0c82e36..94501c6 100644 --- a/src/keys.ts +++ b/src/keys.ts @@ -2,7 +2,6 @@ import { getEnvVar } from './utils/env.js' export const Keys = { clientToken: getEnvVar('CLIENT_TOKEN'), - channel: getEnvVar('CHANNEL_ID'), model: getEnvVar('MODEL'), clientUid: getEnvVar('CLIENT_UID'), guildId: getEnvVar('GUILD_ID'), diff --git a/src/queues/queue.ts b/src/queues/queue.ts index 72b90bd..a3d3a61 100644 --- a/src/queues/queue.ts +++ b/src/queues/queue.ts @@ -53,10 +53,18 @@ export class Queue implements IQueue { } /** - * Geet the queue as an array + * Get the queue as an array * @returns a array of T items */ getItems(): T[] { return this.storage } + + /** + * Set a new queue to modify + * @param newQueue new queue of T[] to modify + */ + setQueue(newQueue: T[]): void { + this.storage = newQueue + } } \ No newline at end of file diff --git a/src/utils/events.ts b/src/utils/events.ts index bde6413..082e78a 100644 --- a/src/utils/events.ts +++ b/src/utils/events.ts @@ -15,7 +15,6 @@ export type EventKeys = keyof ClientEvents // only wants keys of ClientEvents ob * @param clientUid the discord id for the bot */ export type Tokens = { - channel: string, model: string, clientUid: string } diff --git a/src/utils/jsonHandler.ts b/src/utils/jsonHandler.ts index 1ec95a6..2592661 100644 --- a/src/utils/jsonHandler.ts +++ b/src/utils/jsonHandler.ts @@ -1,4 +1,7 @@ +import { ThreadChannel } from 'discord.js' +import { UserMessage } from './events.js' import fs from 'fs' +import path from 'path' export interface Configuration { readonly name: string @@ -10,6 +13,12 @@ export interface Configuration { } } +export interface Thread { + readonly id: string + readonly name: string + messages: UserMessage[] +} + /** * Method to open a file in the working directory and modify/create it * @@ -17,19 +26,19 @@ export interface Configuration { * @param key key value to access * @param value new value to assign */ -export function openFile(filename: string, key: string, value: any) { +export function openConfig(filename: string, key: string, value: any) { // check if the file exists, if not then make the config file if (fs.existsSync(filename)) { fs.readFile(filename, 'utf8', (error, data) => { if (error) - console.log(`[Error: openFile] Incorrect file format`) + console.log(`[Error: openConfig] Incorrect file format`) else { const object = JSON.parse(data) object['options'][key] = value fs.writeFileSync(filename, JSON.stringify(object, null, 2)) } }) - } else { + } else { // work on dynamic file creation const object: Configuration = JSON.parse('{ \"name\": \"Discord Ollama Confirgurations\" }') // set standard information for config file and options @@ -38,10 +47,16 @@ export function openFile(filename: string, key: string, value: any) { } fs.writeFileSync(filename, JSON.stringify(object, null, 2)) - console.log(`[Util: openFile] Created 'config.json' in working directory`) + console.log(`[Util: openConfig] Created '${filename}' in working directory`) } } +/** + * Method to obtain the configurations of the message chat/thread + * + * @param filename name of the configuration file to get + * @param callback function to allow a promise from getting the config + */ export async function getConfig(filename: string, callback: (config: Configuration | undefined) => void): Promise { // attempt to read the file and get the configuration if (fs.existsSync(filename)) { @@ -55,4 +70,59 @@ export async function getConfig(filename: string, callback: (config: Configurati } else { callback(undefined) // file not found } +} + +/** + * Method to open/create and modify a json file containing thread information + * + * @param filename name of the thread file + * @param thread the thread with all of the interactions + * @param message message contents and from who + */ +export function openThreadInfo(filename: string, thread: ThreadChannel, messages: UserMessage[] = []) { + // check if the file exists, if not then make the config file + const fullFileName = `data/${filename}` + if (fs.existsSync(fullFileName)) { + fs.readFile(fullFileName, 'utf8', (error, data) => { + if (error) + console.log(`[Error: openConfig] Incorrect file format`) + else { + const object = JSON.parse(data) + object['messages'] = messages as [] + fs.writeFileSync(fullFileName, JSON.stringify(object, null, 2)) + } + }) + } else { // file doesn't exist, create it + const object: Configuration = JSON.parse(`{ \"id\": \"${thread?.id}\", \"name\": \"${thread?.name}\", \"messages\": []}`) + + const directory = path.dirname(fullFileName) + if (!fs.existsSync(directory)) + fs.mkdirSync(directory, { recursive: true }) + + // only creating it, no need to add anything + fs.writeFileSync(fullFileName, JSON.stringify(object, null, 2)) + console.log(`[Util: openThreadInfo] Created '${fullFileName}' in working directory`) + } +} + +/** + * Method to obtain the configurations of the message chat/thread + * + * @param filename name of the configuration file to get + * @param callback function to allow a promise from getting the config + */ +export async function getThread(filename: string, callback: (config: Thread | undefined) => void): Promise { + // attempt to read the file and get the configuration + const fullFileName = `data/${filename}` + if (fs.existsSync(fullFileName)) { + fs.readFile(fullFileName, 'utf8', (error, data) => { + if (error) { + callback(undefined) + return // something went wrong... stop + } + callback(JSON.parse(data)) + }) + } else { + callback(undefined) // file not found + } } \ No newline at end of file diff --git a/src/utils/messageEmbed.ts b/src/utils/messageEmbed.ts index e2c54ba..7cbb9ea 100644 --- a/src/utils/messageEmbed.ts +++ b/src/utils/messageEmbed.ts @@ -13,7 +13,6 @@ export async function embedMessage( message: Message, ollama: Ollama, tokens: { - channel: string, model: string }, msgHist: Queue, diff --git a/src/utils/messageNormal.ts b/src/utils/messageNormal.ts index a17ce23..a698c2e 100644 --- a/src/utils/messageNormal.ts +++ b/src/utils/messageNormal.ts @@ -13,7 +13,6 @@ export async function normalMessage( message: Message, ollama: Ollama, tokens: { - channel: string, model: string }, msgHist: Queue,