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