From c724e94dd95e62d5ba0cb1b94f6d5d76145302c0 Mon Sep 17 00:00:00 2001 From: TymanWasTaken Date: Tue, 18 May 2021 23:43:22 -0400 Subject: Format --- src/commands/moderation/kick.ts | 27 +++++++++++---------------- src/commands/moderation/role.ts | 7 ++----- src/commands/owner/reload.ts | 4 ++-- src/commands/owner/setlevel.ts | 11 +++++++---- 4 files changed, 22 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index a16e4b0..f31047e 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -64,14 +64,15 @@ export default class KickCommand extends BotCommand { modlogEnry = Modlog.build({ user: user.id, guild: message.guild.id, - moderator: message instanceof Message ? message.author.id : message.user.id, + moderator: + message instanceof Message ? message.author.id : message.user.id, type: ModlogType.KICK, reason }); await modlogEnry.save(); } catch (e) { console.error(e); - yield 'Error saving to database. Please report this to a developer.' + yield 'Error saving to database. Please report this to a developer.'; return; } try { @@ -85,27 +86,25 @@ export default class KickCommand extends BotCommand { } try { await user.kick( - `Kicked by ${message instanceof Message ? message.author.tag : message.user.tag} with ${ - reason ? `reason ${reason}` : 'no reason' - }` + `Kicked by ${ + message instanceof Message ? message.author.tag : message.user.tag + } with ${reason ? `reason ${reason}` : 'no reason'}` ); } catch { yield 'Error kicking :/'; await modlogEnry.destroy(); return; } - yield `Kicked <@!${user.id}> with reason \`${reason || 'No reason given'}\`` + yield `Kicked <@!${user.id}> with reason \`${ + reason || 'No reason given' + }\``; } async exec( message: Message, { user, reason }: { user: GuildMember; reason?: string } ): Promise { - for await (const response of this.genResponses( - message, - user, - reason - )) { + for await (const response of this.genResponses(message, user, reason)) { await message.util.send(response); } } @@ -114,11 +113,7 @@ export default class KickCommand extends BotCommand { message: CommandInteraction, { user, reason }: { user: GuildMember; reason?: string } ): Promise { - for await (const response of this.genResponses( - message, - user, - reason - )) { + for await (const response of this.genResponses(message, user, reason)) { await message.reply(response); } } diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts index daa575d..2a67e5b 100644 --- a/src/commands/moderation/role.ts +++ b/src/commands/moderation/role.ts @@ -89,10 +89,7 @@ export default class RoleCommand extends BotCommand { public async exec( message: Message, - { - user, - role - }: { user: GuildMember; role: Role } + { user, role }: { user: GuildMember; role: Role } ): Promise { if ( !message.member.permissions.has('MANAGE_ROLES') && @@ -165,7 +162,7 @@ export default class RoleCommand extends BotCommand { return message.util.reply( `<:checkmark:837109864101707807> Successfully removed <@&${role.id}> from <@${user.id}>!`, { allowedMentions: AllowedMentions.none() } - ); + ); } else { try { await user.roles.add(role.id); diff --git a/src/commands/owner/reload.ts b/src/commands/owner/reload.ts index 7a508d7..0330b27 100644 --- a/src/commands/owner/reload.ts +++ b/src/commands/owner/reload.ts @@ -34,10 +34,10 @@ export default class ReloadCommand extends BotCommand { } public async exec(message: Message): Promise { - await message.util.send(await this.getResponse()) + await message.util.send(await this.getResponse()); } public async execSlash(message: CommandInteraction): Promise { - await message.reply(await this.getResponse()) + await message.reply(await this.getResponse()); } } diff --git a/src/commands/owner/setlevel.ts b/src/commands/owner/setlevel.ts index c9d28a4..6987385 100644 --- a/src/commands/owner/setlevel.ts +++ b/src/commands/owner/setlevel.ts @@ -64,7 +64,7 @@ export default class SetLevelCommand extends BotCommand { }); levelEntry.xp = Level.convertLevelToXp(level); await levelEntry.save(); - return `Successfully set level of <@${user.id}> to \`${level}\` (\`${levelEntry.xp}\` XP)` + return `Successfully set level of <@${user.id}> to \`${level}\` (\`${levelEntry.xp}\` XP)`; } async exec( @@ -73,15 +73,18 @@ export default class SetLevelCommand extends BotCommand { ): Promise { await message.util.send(await this.setLevel(user, level), { allowedMentions: AllowedMentions.none() - }) + }); } async execSlash( message: CommandInteraction, - { user, level }: { user: SlashCommandOption; level: SlashCommandOption } + { + user, + level + }: { user: SlashCommandOption; level: SlashCommandOption } ): Promise { await message.reply(await this.setLevel(user.user, level.value), { allowedMentions: AllowedMentions.none() - }) + }); } } -- cgit