fix: adjusted readability of the code

This commit is contained in:
Lance Krasniqi
2020-08-12 22:42:08 +02:00
parent 8b3f2bf44f
commit 65af832df4

View File

@@ -17,23 +17,18 @@ const command: ICommand = {
data.push('here\'s a list of all my commands:\n');
const cmds = commands.map(command => command.name);
var cmd;
let cmd;
cmds.forEach(element => {
cmd = commands.get(element) || commands.find(c => c.aliases && c.aliases.includes(element));
var response = `\`${prefix}${cmd.name}\` `;
if (cmd.description)
{
let response = `\`${prefix}${cmd.name}\` `;
if (cmd.description) {
response += `**${cmd.description}** `;
}
if (cmd.aliases)
{
if (cmd.aliases) {
response += `\n\t\t\t*alternatively:* \`${prefix}${cmd.aliases.join(`\`, \`${prefix}`)}\``;
}
data.push(response);
if (cmd.example)
data.push(`\t\t\t*for example:* ${cmd.example}\n`);
else
data.push('')
data.push(cmd.example ? `\t\t\t*for example:* ${cmd.example}\n` : '');
});
data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);
} else {
@@ -51,7 +46,6 @@ const command: ICommand = {
}
}
try {
//await message.author.send(data, { split: true });
//if (message.channel.type === 'dm')