diff options
-rw-r--r-- | src/commands/moulberry-bush/capeperms.ts | 5 | ||||
-rw-r--r-- | src/commands/moulberry-bush/rule.ts | 8 | ||||
-rw-r--r-- | src/lib/extensions/Util.ts | 4 |
3 files changed, 9 insertions, 8 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) { diff --git a/src/lib/extensions/Util.ts b/src/lib/extensions/Util.ts index 0aadc89..c99cb45 100644 --- a/src/lib/extensions/Util.ts +++ b/src/lib/extensions/Util.ts @@ -241,7 +241,7 @@ export class Util extends ClientUtil { const apiRes = (await got .get(`https://api.ashcon.app/mojang/v2/user/${username}`) .json()) as uuidRes; - return apiRes.uuid; + return apiRes.uuid.replace(/-/g, ''); } public async syncSlashCommands(force = false): Promise<void> { @@ -251,7 +251,7 @@ export class Util extends ClientUtil { if ( !this.client.commandHandler.modules.find( (cmd) => cmd.id == registeredCommand.name - ) || + )?.execSlash || force ) { await this.client.application.commands.delete(registeredCommand.id); |