Fix errors when running with arguments | I don't trust this to not break again, xD

This commit is contained in:
IDeletedSystem64 2022-08-10 22:27:17 -05:00
parent 67b126ccff
commit b7c4cb011e
1 changed files with 5 additions and 5 deletions

View File

@ -22,6 +22,7 @@ module.exports = {
if (!command) {
return {
embeds: [{
color: 9442302,
title: `:question: SEYMOUR! THE ${client.user.username} IS ON FIRE!`,
description: `Run ${config.prefix}help for more information on each command.`,
footer: {
@ -35,12 +36,11 @@ module.exports = {
};
}
// const cmdName = args[0].toLowerCase();
const cmdName = command;
const cmd = client.commands.get(cmdName);
console.log(cmd.options.map(option => option.required));
console.log(cmd.options.map);
if (!cmd) {
return client.generateErrorMessage(`${cmdName} is not a valid command! Run ${config.prefix}help for a command list.`);
return client.generateErrorMessage(`${cmdName} is not a valid command. Run ${config.prefix}help for a command list!`);
}
return {
embeds: [{
@ -55,8 +55,8 @@ module.exports = {
{ name: 'Command Name', value: `${cmdName}`, inline: true },
{ name: 'Command Description', value: cmd.description, inline: true },
{ name: 'Command Options', value: cmd.options.map(option => option.name).join('\n') || 'None', inline: true },
{ name: 'Command Option Description', value: cmd.options.map(option => option.description) || 'None', inline: true }
// { name: 'Command Option Required?', value: cmd.options.map(option => option.required) ? 'Yes' : 'No' }
{ name: 'Command Option Description', value: cmd.options.map(option => option.description).join('\n') || 'None', inline: true }
// { name: 'Command Option Required?', value: cmd.options.map(option => option.required) ? 'Yes' : 'No' }
]
}]
};