diff --git a/docker-compose.yml b/docker-compose.yml index 8bb311b..da603de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: build: ./ # find docker file in designated path container_name: discord restart: always # rebuild container always - image: kevinthedang/discord-ollama:0.5.8 + image: kevinthedang/discord-ollama:0.5.9 environment: CLIENT_TOKEN: ${CLIENT_TOKEN} GUILD_ID: ${GUILD_ID} diff --git a/package-lock.json b/package-lock.json index 1b24656..015f7ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord-ollama", - "version": "0.5.8", + "version": "0.5.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "discord-ollama", - "version": "0.5.8", + "version": "0.5.9", "license": "ISC", "dependencies": { "discord.js": "^14.15.3", diff --git a/package.json b/package.json index 6c88e84..6df7b7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-ollama", - "version": "0.5.8", + "version": "0.5.9", "description": "Ollama Integration into discord", "main": "build/index.js", "exports": "./build/index.js", diff --git a/src/utils/handlers/configHandler.ts b/src/utils/handlers/configHandler.ts index ee9746e..a46f394 100644 --- a/src/utils/handlers/configHandler.ts +++ b/src/utils/handlers/configHandler.ts @@ -1,5 +1,6 @@ import { Configuration, ServerConfig, UserConfig, isServerConfigurationKey } from '../index.js' import fs from 'fs' +import path from 'path' /** * Method to open a file in the working directory and modify/create it @@ -35,6 +36,10 @@ export function openConfig(filename: string, key: string, value: any) { [key]: value } + const directory = path.dirname(fullFileName) + if (!fs.existsSync(directory)) + fs.mkdirSync(directory, { recursive: true }) + fs.writeFileSync(`data/${filename}`, JSON.stringify(object, null, 2)) console.log(`[Util: openConfig] Created '${filename}' in working directory`) }