From 57de6733b62c83ff197f9236f71545d8ef1e1103 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 May 2021 04:01:47 +0000 Subject: Automatically format code --- src/commands/moderation/ban.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/commands/moderation/ban.ts') diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index e59a528..0d57203 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -70,7 +70,12 @@ export default class BanCommand extends BushCommand { ] }); } - async *genResponses(message: Message | CommandInteraction, user: User, reason?: string, time?: string): AsyncIterable { + async *genResponses( + message: Message | CommandInteraction, + user: User, + reason?: string, + time?: string + ): AsyncIterable { const duration = moment.duration(); let modlogEnry: Modlog; let banEntry: Ban; @@ -136,17 +141,21 @@ export default class BanCommand extends BushCommand { } try { await user.send( - `You were banned in ${message.guild.name} ${translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'} with reason \`${ - reason || 'No reason given' - }\`` + `You were banned in ${message.guild.name} ${ + translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently' + } with reason \`${reason || 'No reason given'}\`` ); } catch (e) { yield 'Error sending message to user'; } await message.guild.members.ban(user, { - reason: `Banned by ${message instanceof CommandInteraction ? message.user.tag : message.author.tag} with ${reason ? `reason ${reason}` : 'no reason'}` + reason: `Banned by ${message instanceof CommandInteraction ? message.user.tag : message.author.tag} with ${ + reason ? `reason ${reason}` : 'no reason' + }` }); - yield `Banned <@!${user.id}> ${translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'} with reason \`${reason || 'No reason given'}\``; + yield `Banned <@!${user.id}> ${ + translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently' + } with reason \`${reason || 'No reason given'}\``; } catch { yield 'Error banning :/'; await banEntry.destroy(); -- cgit