add modPrompt.txt capabilities
This commit is contained in:
parent
15fb961e79
commit
ec4a40f424
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -135,3 +135,4 @@ config.json.disabled
|
||||||
.ssh/*
|
.ssh/*
|
||||||
!.ssh/.gitkeep
|
!.ssh/.gitkeep
|
||||||
testing/
|
testing/
|
||||||
|
modPrompt.txt
|
5
index.js
5
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 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 timers = {}; // Keep track of reset timers
|
||||||
var basePrompt = config.openai.basePrompt
|
var basePrompt = config.openai.basePrompt
|
||||||
|
// 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();
|
basePrompt.content = fs.readFileSync("./basePrompt.txt", "utf8").toString();
|
||||||
|
}
|
||||||
|
|
||||||
const resetSession = async (id) => {
|
const resetSession = async (id) => {
|
||||||
if (timers[id]) {
|
if (timers[id]) {
|
||||||
|
|
Loading…
Reference in a new issue