diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-28 20:13:49 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-28 20:13:49 -0400 |
commit | 25cf269e2e793de5fefb9aa3f19fb167168e06c6 (patch) | |
tree | cd5f2f3c097a84a2483a70b57b3cbba7b6f4a6be /src/commands/moderation/kick.ts | |
parent | e220f8462bbfb26e3237df34923be4acc5d83fee (diff) | |
download | tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.gz tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.bz2 tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.zip |
stuff
Diffstat (limited to 'src/commands/moderation/kick.ts')
-rw-r--r-- | src/commands/moderation/kick.ts | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index f3ee44c..182485a 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -46,11 +46,7 @@ export default class KickCommand extends BushCommand { }); } - private async *genResponses( - message: Message | CommandInteraction, - user: GuildMember, - reason?: string - ): AsyncIterable<string> { + private async *genResponses(message: Message | CommandInteraction, user: GuildMember, reason?: string): AsyncIterable<string> { let modlogEnry: Modlog; // Create guild entry so postgres doesn't get mad when I try and add a modlog entry await Guild.findOrCreate({ @@ -76,18 +72,12 @@ export default class KickCommand extends BushCommand { return; } try { - await user.send( - `You were kicked in ${message.guild.name} with reason \`${reason || 'No reason given'}\`` - ); + await user.send(`You were kicked in ${message.guild.name} with reason \`${reason || 'No reason given'}\``); } catch (e) { yield 'Error sending message to user'; } try { - await user.kick( - `Kicked by ${message instanceof Message ? message.author.tag : message.user.tag} with ${ - reason ? `reason ${reason}` : 'no reason' - }` - ); + await user.kick(`Kicked by ${message instanceof Message ? message.author.tag : message.user.tag} with ${reason ? `reason ${reason}` : 'no reason'}`); } catch { yield 'Error kicking :/'; await modlogEnry.destroy(); @@ -96,19 +86,13 @@ export default class KickCommand extends BushCommand { yield `Kicked <@!${user.id}> with reason \`${reason || 'No reason given'}\``; } - async exec( - message: Message, - { user, reason }: { user: GuildMember; reason?: string } - ): Promise<void> { + async exec(message: Message, { user, reason }: { user: GuildMember; reason?: string }): Promise<void> { for await (const response of this.genResponses(message, user, reason)) { await message.util.send(response); } } - async execSlash( - message: CommandInteraction, - { user, reason }: { user: GuildMember; reason?: string } - ): Promise<void> { + async execSlash(message: CommandInteraction, { user, reason }: { user: GuildMember; reason?: string }): Promise<void> { for await (const response of this.genResponses(message, user, reason)) { await message.reply(response); } |