diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-05-17 15:37:57 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-05-17 15:37:57 -0400 |
commit | b27d09d2e18a936fe727b2d4254cab7589f61f1f (patch) | |
tree | 177e0ca41cef2f78bb65b09199d6e7ca5faa1671 /src/commands/moulberry-bush | |
parent | 9aee8c80067530b178612f1261c38b83683f266d (diff) | |
download | tanzanite-b27d09d2e18a936fe727b2d4254cab7589f61f1f.tar.gz tanzanite-b27d09d2e18a936fe727b2d4254cab7589f61f1f.tar.bz2 tanzanite-b27d09d2e18a936fe727b2d4254cab7589f61f1f.zip |
it didn't work
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r-- | src/commands/moulberry-bush/capeperms.ts | 5 | ||||
-rw-r--r-- | src/commands/moulberry-bush/rule.ts | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/commands/moulberry-bush/capeperms.ts b/src/commands/moulberry-bush/capeperms.ts index 7a79666..5b3dc10 100644 --- a/src/commands/moulberry-bush/capeperms.ts +++ b/src/commands/moulberry-bush/capeperms.ts @@ -4,6 +4,7 @@ import { CommandInteraction } from 'discord.js'; import { Message } from 'discord.js'; import got from 'got'; import { BotCommand } from '../../lib/extensions/BotCommand'; +import { SlashCommandOption } from '../../lib/extensions/Util'; interface Capeperms { success: boolean; @@ -118,8 +119,8 @@ export default class CapePermsCommand extends BotCommand { public async execSlash( message: CommandInteraction, - { user }: { user: string } + { user }: { user: SlashCommandOption<string> } ): Promise<void> { - await message.reply(await this.getResponse(user)); + await message.reply(await this.getResponse(user.value)); } } diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index a9414ea..63172d1 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -103,7 +103,7 @@ export default class RuleCommand extends BotCommand { channel: 'guild', slashCommandOptions: [ { - type: ApplicationCommandOptionType.STRING, + type: ApplicationCommandOptionType.INTEGER, name: 'rule', description: 'The rule to show', required: false @@ -138,11 +138,11 @@ export default class RuleCommand extends BotCommand { ); } if (rule) { - const foundRule = this.rules[rule]; - rulesEmbed.addField(foundRule.title, foundRule.description); + const foundRule = this.rules[rule - 1]; + rulesEmbed.addField(`${rule}) ${foundRule.title}`, foundRule.description); } else { for (const curRule of this.rules) { - rulesEmbed.addField(curRule.title, curRule.description); + rulesEmbed.addField(`${this.rules.indexOf(curRule) + 1}) ${curRule.title}`, curRule.description); } } if (!user) { |