diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-10-16 18:56:47 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-10-16 18:56:47 -0400 |
commit | 46d087e17a549a3b1bb9797714d5c3df440b67f5 (patch) | |
tree | a536a9dacf59e53d4288b839d80e20a392ac1190 /src/commands/moderation/unban.ts | |
parent | 2b12b94e08f4ffdbb35d6f623604657944450a82 (diff) | |
download | tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.gz tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.bz2 tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.zip |
moderation changes + appeals progress
Diffstat (limited to 'src/commands/moderation/unban.ts')
-rw-r--r-- | src/commands/moderation/unban.ts | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index 537e176..3037fd0 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -2,17 +2,14 @@ import { AllowedMentions, Arg, BotCommand, - emojis, - format, - unbanResponse, + formatUnbanResponse, type ArgType, type CommandMessage, type OptArgType, - type SlashMessage, - type UnbanResponse + type SlashMessage } from '#lib'; import assert from 'assert/strict'; -import { ApplicationCommandOptionType, type User } from 'discord.js'; +import { ApplicationCommandOptionType } from 'discord.js'; export default class UnbanCommand extends BotCommand { public constructor() { @@ -62,29 +59,8 @@ export default class UnbanCommand extends BotCommand { }); return await message.util.reply({ - content: UnbanCommand.formatCode(user, responseCode), + content: formatUnbanResponse(user, responseCode), allowedMentions: AllowedMentions.none() }); } - - public static formatCode(user: User, code: UnbanResponse): string { - const victim = format.input(user.tag); - switch (code) { - case unbanResponse.MISSING_PERMISSIONS: - return `${emojis.error} Could not unban ${victim} because I am missing the **Ban Members** permission.`; - case unbanResponse.ACTION_ERROR: - return `${emojis.error} An error occurred while trying to unban ${victim}.`; - case unbanResponse.PUNISHMENT_ENTRY_REMOVE_ERROR: - return `${emojis.error} While unbanning ${victim}, there was an error removing their ban entry, please report this to my developers.`; - case unbanResponse.MODLOG_ERROR: - return `${emojis.error} While unbanning ${victim}, there was an error creating a modlog entry, please report this to my developers.`; - case unbanResponse.NOT_BANNED: - return `${emojis.warn} ${victim} is not banned but I tried to unban them anyways.`; - case unbanResponse.DM_ERROR: - case unbanResponse.SUCCESS: - return `${emojis.success} Successfully unbanned ${victim}.`; - default: - return `${emojis.error} An error occurred: ${format.input(code)}}`; - } - } } |