added modhelp alias, triggers modhelp embed

This commit is contained in:
Erik 2021-05-06 20:21:07 +03:00
parent 6efedf8fa5
commit c8bbe2acb7

View File

@ -7,7 +7,8 @@ class HelpCommand extends Command {
super(client, {
name: 'help',
module: 'information',
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS']
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
aliases: ['modhelp']
});
this.client = client;
@ -16,12 +17,11 @@ class HelpCommand extends Command {
async execute(message, { params }) {
if (!params.length) return message.embed({
const [key] = params;
if (message._caller === 'modhelp' || key?.toLowerCase() === 'modhelp') return this._modhelp(message);
else if (!params.length) return message.embed({
description: message.format('C_HELP')
});
const [ key ] = params;
if (key.toLowerCase() === 'modhelp') return this._modhelp(message);
let [ result ] = this.client.resolver.components(key, 'command');
if (!result) [ result ] = this.client.resolver.components(key, 'setting');