Add a little NSFW prompt, for shits and giggles. It'll need tweaking over time

This commit is contained in:
Christopher Cookman 2023-03-12 09:33:16 -06:00
parent 758c58734e
commit ec289a1113
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 16 additions and 4 deletions

View file

@ -158,10 +158,17 @@ client.on('messageCreate', async (message) => {
if (message.content.startsWith("!!")) return; // So you can chat without the bot replying
// If the session doesn't exist, create it
if (!sessions[message.channelId]) {
sessions[message.channelId] = {
messages: [basePrompt],
started: new Date(),
};
if (message.channel.nsfw) {
sessions[message.channelId] = {
messages: [basePrompt, nsfwPrompt],
started: new Date(),
}
} else {
sessions[message.channelId] = {
messages: [basePrompt],
started: new Date(),
};
}
}
// If the session already exists, reset the timer
if (timers[message.channelId]) {
@ -262,6 +269,10 @@ if (fs.existsSync(path.join(__dirname, "modPrompt.txt"))) {
basePrompt.content = fs.readFileSync("./basePrompt.txt", "utf8").toString();
}
var nsfwPrompt = config.openai.basePrompt
// read nsfwPrompt.txt
nsfwPrompt.content = fs.readFileSync("./nsfwPrompt.txt", "utf8").toString();
// Handle SIGINT gracefully
process.on('SIGINT', async () => {
await console.log(`${colors.cyan("[INFO]")} Stop received, exiting...`);

1
nsfwPrompt.txt Normal file
View file

@ -0,0 +1 @@
You are allowed to discuss sexually explicit content