aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/ban.ts
diff options
context:
space:
mode:
authorTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-28 22:08:28 -0600
committerTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-28 22:08:28 -0600
commitee665e568f244e1c465748718691404b7bf6feb0 (patch)
tree847333085377020969ce13cd6652d8894c503426 /src/commands/moderation/ban.ts
parent35d8cbda559c479c66800d39535df02c807dc33a (diff)
parent57de6733b62c83ff197f9236f71545d8ef1e1103 (diff)
downloadtanzanite-ee665e568f244e1c465748718691404b7bf6feb0.tar.gz
tanzanite-ee665e568f244e1c465748718691404b7bf6feb0.tar.bz2
tanzanite-ee665e568f244e1c465748718691404b7bf6feb0.zip
Merge branch 'rewrite' of github.com:NotEnoughUpdates/bush-bot into rewrite
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r--src/commands/moderation/ban.ts21
1 files changed, 15 insertions, 6 deletions
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<string> {
+ async *genResponses(
+ message: Message | CommandInteraction,
+ user: User,
+ reason?: string,
+ time?: string
+ ): AsyncIterable<string> {
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();