add modPrompt.txt capabilities
This commit is contained in:
parent
15fb961e79
commit
ec4a40f424
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -134,4 +134,5 @@ config.json.old
|
|||
config.json.disabled
|
||||
.ssh/*
|
||||
!.ssh/.gitkeep
|
||||
testing/
|
||||
testing/
|
||||
modPrompt.txt
|
7
index.js
7
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]) {
|
||||
|
|
Loading…
Reference in a new issue