rand
This commit is contained in:
@ -2,7 +2,7 @@ const Discord = require('discord.js');
|
||||
const fetch = require('node-fetch');
|
||||
const emptyResponses = require('./assets/emptyMessages.js');
|
||||
const {resetResponses, userResetMessages} = require('./assets/resetMessages.js');
|
||||
const errorMessages = require('./assets/errorMessages.js');
|
||||
const {errorMessages, busyResponses} = require('./assets/errorMessages.js');
|
||||
|
||||
require('dotenv').config()
|
||||
// hi
|
||||
@ -49,7 +49,8 @@ client.on('messageCreate', async (message) => {
|
||||
|
||||
if (conversations.get(message.author.id)?.busy) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -152,6 +153,7 @@ async function generateResponse(conversation) {
|
||||
});
|
||||
|
||||
const responseData = await response.json();
|
||||
console.log(JSON.stringify(responseData))
|
||||
const choice = responseData.choices[0];
|
||||
|
||||
// Remove "user None:" and any text after it from the response
|
||||
|
Reference in New Issue
Block a user