make pretty

This commit is contained in:
Raven Scott 2023-04-10 04:38:38 +02:00
parent 40e865521d
commit fd92269e3c

View File

@ -1,8 +1,14 @@
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, busyResponses } = require('./assets/errorMessages.js');
const {
resetResponses,
userResetMessages
} = require('./assets/resetMessages.js');
const {
errorMessages,
busyResponses
} = require('./assets/errorMessages.js');
require('dotenv').config()
@ -33,7 +39,9 @@ function setBusy(userId, isBusy) {
if (conversations.has(userId)) {
conversations.get(userId).busy = isBusy;
} else {
conversations.set(userId, { busy: isBusy });
conversations.set(userId, {
busy: isBusy
});
}
}
@ -71,13 +79,11 @@ function setPresenceOnline() {
client.once('ready', () => {
console.log('Bot is ready.');
setPresenceOnline()
setPresenceOnline()
});
client.on('messageCreate', async (message) => {
async function sendRand(array) {
const arrayChoice = array[Math.floor(Math.random() * array.length)];
await message.channel.send(arrayChoice); // give a notification of reset using a human like response.
@ -108,9 +114,6 @@ client.on('messageCreate', async (message) => {
busy: false
};
if (conversation.messages.length === 0) {
conversation.messages.push({
role: 'user',
@ -222,5 +225,4 @@ async function generateResponse(conversation) {
}
}
client.login(process.env.THE_TOKEN); // Replace with your bot token