diff options
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r-- | src/commands/moulberry-bush/capePerms.ts | 12 | ||||
-rw-r--r-- | src/commands/moulberry-bush/giveawayPing.ts | 14 | ||||
-rw-r--r-- | src/commands/moulberry-bush/level.ts | 9 | ||||
-rw-r--r-- | src/commands/moulberry-bush/rule.ts | 5 |
4 files changed, 13 insertions, 27 deletions
diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts index fdb5caf..92ccd73 100644 --- a/src/commands/moulberry-bush/capePerms.ts +++ b/src/commands/moulberry-bush/capePerms.ts @@ -70,8 +70,7 @@ export default class CapePermissionsCommand extends BushCommand { { type: ApplicationCommandOptionType.STRING, name: 'user', - description: - 'The username of the player to see the cape permissions of', + description: 'The username of the player to see the cape permissions of', required: true } ] @@ -86,9 +85,7 @@ export default class CapePermissionsCommand extends BushCommand { } try { - capeperms = await got - .get('http://moulberry.codes/permscapes.json') - .json(); + capeperms = await got.get('http://moulberry.codes/permscapes.json').json(); } catch (error) { capeperms = null; } @@ -110,10 +107,7 @@ export default class CapePermissionsCommand extends BushCommand { } } } - public async exec( - message: Message, - { user }: { user: string } - ): Promise<void> { + public async exec(message: Message, { user }: { user: string }): Promise<void> { await message.reply(await this.getResponse(user)); } diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index e6fdd9a..06cb254 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -36,21 +36,17 @@ export default class GiveawayPingCommand extends BushCommand { return message.reply( "<:error:837123021016924261> This command may only be run in Moulberry's Bush." ); - if ( - !['767782084981817344', '833855738501267456'].includes(message.channel.id) - ) + if (!['767782084981817344', '833855738501267456'].includes(message.channel.id)) return message.reply( '<:error:837123021016924261> This command may only be run in giveaway channels.' ); await message.delete().catch(() => undefined); - const webhooks = await ( - message.channel as TextChannel | NewsChannel - ).fetchWebhooks(); + const webhooks = await (message.channel as TextChannel | NewsChannel).fetchWebhooks(); let webhookClient: WebhookClient; if (webhooks.size < 1) { - const webhook = await ( - message.channel as TextChannel | NewsChannel - ).createWebhook('Giveaway ping webhook'); + const webhook = await (message.channel as TextChannel | NewsChannel).createWebhook( + 'Giveaway ping webhook' + ); webhookClient = new WebhookClient(webhook.id, webhook.token); } else { const webhook = webhooks.first(); diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index decac8a..74d6cf4 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -22,8 +22,7 @@ export default class LevelCommand extends BushCommand { type: 'user', prompt: { start: 'What user would you like to see the level of?', - retry: - 'Invalid user. What user would you like to see the level of?', + retry: 'Invalid user. What user would you like to see the level of?', optional: true } } @@ -42,9 +41,9 @@ export default class LevelCommand extends BushCommand { private async getResponse(user: User): Promise<string> { const userLevelRow = await Level.findByPk(user.id); if (userLevelRow) { - return `${user ? `${user.tag}'s` : 'Your'} level is ${ - userLevelRow.level - } (${userLevelRow.xp} XP)`; + return `${user ? `${user.tag}'s` : 'Your'} level is ${userLevelRow.level} (${ + userLevelRow.xp + } XP)`; } else { return `${user ? `${user.tag} does` : 'You do'} not have a level yet!`; } diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 69dcb6e..6984603 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -171,10 +171,7 @@ export default class RuleCommand extends BushCommand { public async execSlash( message: CommandInteraction, - { - rule, - user - }: { rule?: SlashCommandOption<number>; user?: SlashCommandOption<void> } + { rule, user }: { rule?: SlashCommandOption<number>; user?: SlashCommandOption<void> } ): Promise<void> { const response = this.getResponse(message, rule?.value, user?.user); if (Array.isArray(response)) { |