aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/ban.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-10-16 18:56:47 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-10-16 18:56:47 -0400
commit46d087e17a549a3b1bb9797714d5c3df440b67f5 (patch)
treea536a9dacf59e53d4288b839d80e20a392ac1190 /src/commands/moderation/ban.ts
parent2b12b94e08f4ffdbb35d6f623604657944450a82 (diff)
downloadtanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.gz
tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.bz2
tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.zip
moderation changes + appeals progress
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r--src/commands/moderation/ban.ts30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index ae77cde..851c2e9 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -1,20 +1,18 @@
import {
AllowedMentions,
Arg,
- banResponse,
BotCommand,
castDurationContent,
emojis,
- format,
+ formatBanResponse,
Moderation,
type ArgType,
- type BanResponse,
type CommandMessage,
type OptArgType,
type SlashMessage
} from '#lib';
import assert from 'assert/strict';
-import { ApplicationCommandOptionType, type User } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord.js';
export default class BanCommand extends BotCommand {
public constructor() {
@@ -113,30 +111,8 @@ export default class BanCommand extends BotCommand {
const responseCode = member ? await member.customBan(opts) : await message.guild.customBan({ user, ...opts });
return await message.util.reply({
- content: BanCommand.formatCode(user, responseCode),
+ content: formatBanResponse(user, responseCode),
allowedMentions: AllowedMentions.none()
});
}
-
- public static formatCode(user: User, code: BanResponse): string {
- const victim = format.input(user.tag);
- switch (code) {
- case banResponse.ALREADY_BANNED:
- return `${emojis.error} ${victim} is already banned.`;
- case banResponse.MISSING_PERMISSIONS:
- return `${emojis.error} Could not ban ${victim} because I am missing the **Ban Members** permission.`;
- case banResponse.ACTION_ERROR:
- return `${emojis.error} An error occurred while trying to ban ${victim}.`;
- case banResponse.PUNISHMENT_ENTRY_ADD_ERROR:
- return `${emojis.error} While banning ${victim}, there was an error creating a ban entry, please report this to my developers.`;
- case banResponse.MODLOG_ERROR:
- return `${emojis.error} While banning ${victim}, there was an error creating a modlog entry, please report this to my developers.`;
- case banResponse.DM_ERROR:
- return `${emojis.warn} Banned ${victim} however I could not send them a dm.`;
- case banResponse.SUCCESS:
- return `${emojis.success} Successfully banned ${victim}.`;
- default:
- return `${emojis.error} An error occurred: ${format.input(code)}}`;
- }
- }
}