Adding in more responses for when users refresh manually

This commit is contained in:
Raven Scott 2023-04-10 02:10:02 +02:00
parent da270f2f60
commit 0953663059
2 changed files with 28 additions and 4 deletions

View File

@ -21,4 +21,27 @@ const resetResponses = [
"Let's hit the restart button to make sure we're on the right track. What can I help you with now?"
];
module.exports = resetResponses;
const userResetMessages = [
"All good, we're starting fresh! How can I assist you?",
"Got it, let's start over! How can I help you today?",
"Alright, starting anew! What can I help you with?",
"No problem, we're starting fresh! What do you need help with?",
"Understood, let's start from scratch! What do you want to talk about?",
"Sure thing, we'll start over! What can I help you with today?",
"Gotcha, we'll start fresh! What's on your mind?",
"No worries, we'll start from the beginning! What do you need help with?",
"Starting over, got it! What can I assist you with?",
"Copy that, we'll start anew! What do you want to chat about?",
"Conversation reset, check! What do you need help with?",
"All set, we'll start fresh! What can I help you with today?",
"Starting over, no problem! What can I help you with?",
"Understood, we're starting from scratch! What can I assist you with?",
"Got it, we're starting over! What do you need help with?",
"Copy that, starting anew! What do you want to talk about?",
"No worries, we'll start fresh! What's on your mind?",
"All good, we'll start from the beginning! What do you need help with?",
"Sure thing, we'll start over! What can I help you with today?",
"Conversation reset, confirmed! What do you need help with?"
];
module.exports = {resetResponses, userResetMessages};

View File

@ -1,7 +1,7 @@
const Discord = require('discord.js');
const fetch = require('node-fetch');
const emptyResponses = require('./assets/emptyMessages.js');
const resetResponses = require('./assets/resetMessages.js');
const {resetResponses, userResetMessages} = require('./assets/resetMessages.js');
const errorMessages = require('./assets/errorMessages.js');
require('dotenv').config()
@ -87,7 +87,8 @@ client.on('messageCreate', async (message) => {
}
if (message.content === '!reset' || message.content === '!r') {
conversations.delete(userID); // Delete user's conversation map if they request reset
await message.channel.send('Conversation reset.');
const userResetMessage = userResetMessages[Math.floor(Math.random() * userResetMessages.length)];
await message.channel.send(userResetMessage); // give a notification of reset using a human like response.
return;
}
@ -138,7 +139,7 @@ async function generateResponse(conversation) {
}, 900000);
try {
const response = await fetch('http://192.168.0.15/v1/chat/completions', {
const response = await fetch(`http://${process.env.ROOT_IP}:${process.env.ROOT_PORT}/v1/chat/completions`, {
method: 'POST',
headers: {
'accept': 'application/json',