aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-05-17 14:06:24 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-05-17 14:06:24 -0400
commit9aee8c80067530b178612f1261c38b83683f266d (patch)
tree2ac52f719bdd77ef0265da2de02336f0759deaba /src/commands/info
parent4d63c4af57a7391dd61106b79874b8e83c14971a (diff)
downloadtanzanite-9aee8c80067530b178612f1261c38b83683f266d.tar.gz
tanzanite-9aee8c80067530b178612f1261c38b83683f266d.tar.bz2
tanzanite-9aee8c80067530b178612f1261c38b83683f266d.zip
probably works idk what all I did
Diffstat (limited to 'src/commands/info')
-rw-r--r--src/commands/info/help.ts57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index cdddb51..116669c 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -3,6 +3,7 @@ import { BotCommand } from '../../lib/extensions/BotCommand';
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 {
constructor() {
@@ -57,29 +58,29 @@ export default class HelpCommand extends BotCommand {
);
}
return embed;
- }
-
- 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__' : ''
- }`
- );
+ } 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__' : ''
+ }`
+ );
- 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;
+ 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(
@@ -89,13 +90,15 @@ export default class HelpCommand extends BotCommand {
await message.util.send(this.generateEmbed(command));
}
- public async execSlash(message: CommandInteraction): Promise<void> {
- const command = message.options.find((o) => o.name === 'command')?.value as
- | string
- | undefined;
+ public async execSlash(
+ message: CommandInteraction,
+ { command }: { command: SlashCommandOption<string> }
+ ): Promise<void> {
if (command) {
await message.reply(
- this.generateEmbed(this.handler.findCommand(command) as BotCommand)
+ this.generateEmbed(
+ this.handler.findCommand(command.value) as BotCommand
+ )
);
} else {
await message.reply(this.generateEmbed());