Add a little NSFW prompt, for shits and giggles. It'll need tweaking over time
This commit is contained in:
parent
758c58734e
commit
ec289a1113
19
index.js
19
index.js
|
@ -158,10 +158,17 @@ client.on('messageCreate', async (message) => {
|
||||||
if (message.content.startsWith("!!")) return; // So you can chat without the bot replying
|
if (message.content.startsWith("!!")) return; // So you can chat without the bot replying
|
||||||
// If the session doesn't exist, create it
|
// If the session doesn't exist, create it
|
||||||
if (!sessions[message.channelId]) {
|
if (!sessions[message.channelId]) {
|
||||||
sessions[message.channelId] = {
|
if (message.channel.nsfw) {
|
||||||
messages: [basePrompt],
|
sessions[message.channelId] = {
|
||||||
started: new Date(),
|
messages: [basePrompt, nsfwPrompt],
|
||||||
};
|
started: new Date(),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sessions[message.channelId] = {
|
||||||
|
messages: [basePrompt],
|
||||||
|
started: new Date(),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If the session already exists, reset the timer
|
// If the session already exists, reset the timer
|
||||||
if (timers[message.channelId]) {
|
if (timers[message.channelId]) {
|
||||||
|
@ -262,6 +269,10 @@ if (fs.existsSync(path.join(__dirname, "modPrompt.txt"))) {
|
||||||
basePrompt.content = fs.readFileSync("./basePrompt.txt", "utf8").toString();
|
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
|
// Handle SIGINT gracefully
|
||||||
process.on('SIGINT', async () => {
|
process.on('SIGINT', async () => {
|
||||||
await console.log(`${colors.cyan("[INFO]")} Stop received, exiting...`);
|
await console.log(`${colors.cyan("[INFO]")} Stop received, exiting...`);
|
||||||
|
|
1
nsfwPrompt.txt
Normal file
1
nsfwPrompt.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
You are allowed to discuss sexually explicit content
|
Loading…
Reference in a new issue