From fd92269e3cc6e12550d7de25dc1f3f5db14507ce Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Mon, 10 Apr 2023 04:38:38 +0200 Subject: [PATCH] make pretty --- llamabot.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/llamabot.js b/llamabot.js index 5c55365..8087f29 100644 --- a/llamabot.js +++ b/llamabot.js @@ -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 \ No newline at end of file