Compare commits

..

No commits in common. "e4c389be71c79fe0dba5be4b278e33edca43110d" and "be83b9ea749e6d788cf118478766754335ce2d92" have entirely different histories.

3 changed files with 13 additions and 5 deletions

View File

@ -19,16 +19,16 @@ module.exports = {
for (const [key, value] of dotCommands) {
if (key === this.command) {
this.isValid = true;
return this;
return this.isValid;
} else if (value.alias && value.alias.includes(this.command)) {
this.command = key;
this.isValid = true;
return this;
return this.isValid;
}
}
this.isValid = validCommands.includes(this.command);
return this;
return this.isValid;
}
},
GifData: class {

View File

@ -171,6 +171,14 @@ 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

View File

@ -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, CommandData } = require('./CustomModules/NodBot.js');
const { GifData } = 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 = new CommandData(message).validate(message.client.dotCommands);
const commandData = fn.dot.getCommandData(message);
console.log(commandData);
if (commandData.isValid && commandData.isCommand) {