From ecbfc2bc2aad2d01eef0b3cb68b39938c6fcb890 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 25 Sep 2024 15:35:01 -0400 Subject: [PATCH] Remove unnecessary function calls now that classes exist --- CustomModules/NodBot.js | 6 +++--- functions.js | 8 -------- main.js | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CustomModules/NodBot.js b/CustomModules/NodBot.js index ac29c41..2d2ed16 100644 --- a/CustomModules/NodBot.js +++ b/CustomModules/NodBot.js @@ -19,16 +19,16 @@ module.exports = { for (const [key, value] of dotCommands) { if (key === this.command) { this.isValid = true; - return this.isValid; + return this; } else if (value.alias && value.alias.includes(this.command)) { this.command = key; this.isValid = true; - return this.isValid; + return this; } } this.isValid = validCommands.includes(this.command); - return this.isValid; + return this; } }, GifData: class { diff --git a/functions.js b/functions.js index eeaeb3f..608848d 100644 --- a/functions.js +++ b/functions.js @@ -171,14 +171,6 @@ const functions = { if (isDev) console.log('Medical Advice Collection Built'); } }, - dot: { - getCommandData(message) { - const commandData = new CommandData(message); - const { validCommands } = require('./config.json'); - commandData.validate(message.client.dotCommands); - return commandData; - } - }, embeds: { help(interaction) { // Construct the Help Embed diff --git a/main.js b/main.js index 55a347c..2493676 100644 --- a/main.js +++ b/main.js @@ -27,7 +27,7 @@ const { MessageActionRow, MessageButton } = require('discord.js'); const fn = require('./functions.js'); const config = require('./config.json'); const strings = require('./strings.json'); -const { GifData } = require('./CustomModules/NodBot.js'); +const { GifData, CommandData } = require('./CustomModules/NodBot.js'); const isDev = process.env.isDev; client.once('ready', async () => { @@ -232,7 +232,7 @@ client.on('messageCreate', message => { }); // Break the message down into its components and analyze it - const commandData = fn.dot.getCommandData(message); + const commandData = new CommandData(message).validate(message.client.dotCommands); console.log(commandData); if (commandData.isValid && commandData.isCommand) {