diff options
author | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-28 21:54:50 -0600 |
---|---|---|
committer | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-28 21:54:50 -0600 |
commit | 2456dab3db0d8eaae515606b83a6c0c317d009b0 (patch) | |
tree | c20448112d43c1b4ffae1395584d9b202aeee3ed /src/commands/info/help.ts | |
parent | 1e9e334097702c68d871365fc016aa096d03c491 (diff) | |
parent | 5b5f0bf5667b922037508dfa88e40a1f8a2671ec (diff) | |
download | tanzanite-2456dab3db0d8eaae515606b83a6c0c317d009b0.tar.gz tanzanite-2456dab3db0d8eaae515606b83a6c0c317d009b0.tar.bz2 tanzanite-2456dab3db0d8eaae515606b83a6c0c317d009b0.zip |
fix conflicts
Diffstat (limited to 'src/commands/info/help.ts')
-rw-r--r-- | src/commands/info/help.ts | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 116669c..7f6c8f4 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -1,14 +1,15 @@ import { Message, MessageEmbed } from 'discord.js'; -import { BotCommand } from '../../lib/extensions/BotCommand'; +import { BushCommand } from '../../lib/extensions/BushCommand'; import { stripIndent } from 'common-tags'; import { ApplicationCommandOptionType } from 'discord-api-types'; import { CommandInteraction } from 'discord.js'; import { SlashCommandOption } from '../../lib/extensions/Util'; -export default class HelpCommand extends BotCommand { +export default class HelpCommand extends BushCommand { constructor() { super('help', { aliases: ['help'], + category: 'info', description: { content: 'Shows the commands of the bot', usage: 'help', @@ -32,7 +33,7 @@ export default class HelpCommand extends BotCommand { }); } - private generateEmbed(command?: BotCommand): MessageEmbed { + private generateEmbed(command?: BushCommand): MessageEmbed { const prefix = this.handler.prefix; if (!command) { const embed = new MessageEmbed() @@ -42,15 +43,11 @@ export default class HelpCommand extends BotCommand { For additional info on a command, type \`${prefix}help <command>\` ` ) - .setFooter( - `For more information about a command use "${this.client.config.prefix}help <command>"` - ) + .setFooter(`For more information about a command use "${this.client.config.prefix}help <command>"`) .setTimestamp(); for (const category of this.handler.categories.values()) { embed.addField( - `${category.id.replace(/(\b\w)/gi, (lc): string => - lc.toUpperCase() - )}`, + `${category.id.replace(/(\b\w)/gi, (lc): string => lc.toUpperCase())}`, `${category .filter((cmd): boolean => cmd.aliases.length > 0) .map((cmd): string => `\`${cmd.aliases[0]}\``) @@ -61,45 +58,22 @@ export default class HelpCommand extends BotCommand { } else { const embed = new MessageEmbed() .setColor([155, 200, 200]) - .setTitle( - `\`${command.description.usage ? command.description.usage : ''}\`` - ) - .addField( - 'Description', - `${command.description.content ? command.description.content : ''} ${ - command.ownerOnly ? '\n__Owner Only__' : '' - }` - ); + .setTitle(`\`${command.description.usage ? command.description.usage : ''}\``) + .addField('Description', `${command.description.content ? command.description.content : ''} ${command.ownerOnly ? '\n__Owner Only__' : ''}`); - if (command.aliases.length > 1) - embed.addField('Aliases', `\`${command.aliases.join('` `')}\``, true); - if (command.description.examples && command.description.examples.length) - embed.addField( - 'Examples', - `\`${command.description.examples.join('`\n`')}\``, - true - ); + if (command.aliases.length > 1) embed.addField('Aliases', `\`${command.aliases.join('` `')}\``, true); + if (command.description.examples && command.description.examples.length) embed.addField('Examples', `\`${command.description.examples.join('`\n`')}\``, true); return embed; } } - public async exec( - message: Message, - { command }: { command: BotCommand } - ): Promise<void> { + public async exec(message: Message, { command }: { command: BushCommand }): Promise<void> { await message.util.send(this.generateEmbed(command)); } - public async execSlash( - message: CommandInteraction, - { command }: { command: SlashCommandOption<string> } - ): Promise<void> { + public async execSlash(message: CommandInteraction, { command }: { command: SlashCommandOption<string> }): Promise<void> { if (command) { - await message.reply( - this.generateEmbed( - this.handler.findCommand(command.value) as BotCommand - ) - ); + await message.reply(this.generateEmbed(this.handler.findCommand(command.value) as BushCommand)); } else { await message.reply(this.generateEmbed()); } |