diff --git a/.gitignore b/.gitignore index e872a71..189da84 100644 --- a/.gitignore +++ b/.gitignore @@ -134,4 +134,5 @@ config.json.old config.json.disabled .ssh/* !.ssh/.gitkeep -testing/ \ No newline at end of file +testing/ +modPrompt.txt \ No newline at end of file diff --git a/index.js b/index.js index 767133c..cd6753f 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,12 @@ const client = new Discord.Client({ var sessions = {}; // Keep track of sessions, not really used right now, but if I wanted to allow multiple sessions, I could var timers = {}; // Keep track of reset timers var basePrompt = config.openai.basePrompt -basePrompt.content = fs.readFileSync("./basePrompt.txt", "utf8").toString(); +// If modPrompt.txt exists, use that instead of basePrompt.txt +if (fs.existsSync(path.join(__dirname, "modPrompt.txt"))) { + basePrompt.content = fs.readFileSync("./modPrompt.txt", "utf8").toString(); +} else { + basePrompt.content = fs.readFileSync("./basePrompt.txt", "utf8").toString(); +} const resetSession = async (id) => { if (timers[id]) {