rand
This commit is contained in:
parent
8b24a80279
commit
27d8ad1f78
@ -21,12 +21,27 @@ const errorMessages = [
|
|||||||
"Oopsie daisy! Give !reset a try and we'll start over."
|
"Oopsie daisy! Give !reset a try and we'll start over."
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = errorMessages;
|
const busyResponses = [
|
||||||
|
"Sorry about that! Looks like I'm tied up at the moment. Please try again later.",
|
||||||
|
"Oops, I'm currently busy with something else. Please try again later.",
|
||||||
|
"Looks like I'm already working on something. Can you try again later?",
|
||||||
|
"I'm currently occupied with another process. Can you try again later?",
|
||||||
|
"I'm currently unavailable. Can you try again in a bit?",
|
||||||
|
"Looks like I'm currently busy. Can you check back later?",
|
||||||
|
"I'm currently engaged with another process. Please try again later.",
|
||||||
|
"I'm afraid I'm currently occupied with another request. Can you try again later?",
|
||||||
|
"Sorry, I'm currently busy with another task. Can you try again later?",
|
||||||
|
"I'm currently tied up with another request. Please try again later.",
|
||||||
|
"Looks like I'm currently busy with something else. Can you try again later?",
|
||||||
|
"I'm currently engaged with another task. Please try again later.",
|
||||||
|
"Sorry, I'm currently occupied with another process. Can you try again later?",
|
||||||
|
"I'm currently occupied with another task. Can you try again later?",
|
||||||
|
"I'm currently in the middle of another process. Can you try again later?",
|
||||||
|
"Sorry, I'm currently engaged with another task. Please try again later.",
|
||||||
|
"I'm currently in the middle of something else. Please try again later.",
|
||||||
|
"I'm afraid I'm busy with something else at the moment. Can you try again later?",
|
||||||
|
"Looks like I'm currently engaged with something else. Please try again later.",
|
||||||
|
"I'm currently unavailable. Can you try again later?"
|
||||||
|
];
|
||||||
|
|
||||||
|
module.exports = { errorMessages, busyResponses};
|
@ -2,7 +2,7 @@ const Discord = require('discord.js');
|
|||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
const emptyResponses = require('./assets/emptyMessages.js');
|
const emptyResponses = require('./assets/emptyMessages.js');
|
||||||
const {resetResponses, userResetMessages} = require('./assets/resetMessages.js');
|
const {resetResponses, userResetMessages} = require('./assets/resetMessages.js');
|
||||||
const errorMessages = require('./assets/errorMessages.js');
|
const {errorMessages, busyResponses} = require('./assets/errorMessages.js');
|
||||||
|
|
||||||
require('dotenv').config()
|
require('dotenv').config()
|
||||||
// hi
|
// hi
|
||||||
@ -49,7 +49,8 @@ client.on('messageCreate', async (message) => {
|
|||||||
|
|
||||||
if (conversations.get(message.author.id)?.busy) {
|
if (conversations.get(message.author.id)?.busy) {
|
||||||
message.delete()
|
message.delete()
|
||||||
await message.author.send("I'm currently busy with another process. Please try again later.");
|
const busyResponse = busyResponses[Math.floor(Math.random() * busyResponses.length)];
|
||||||
|
await message.author.send(busyResponse); // give a notification of reset using a human like response.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +153,7 @@ async function generateResponse(conversation) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const responseData = await response.json();
|
const responseData = await response.json();
|
||||||
|
console.log(JSON.stringify(responseData))
|
||||||
const choice = responseData.choices[0];
|
const choice = responseData.choices[0];
|
||||||
|
|
||||||
// Remove "user None:" and any text after it from the response
|
// Remove "user None:" and any text after it from the response
|
||||||
|
Loading…
Reference in New Issue
Block a user