aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/unblock.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/unblock.ts
parent2b12b94e08f4ffdbb35d6f623604657944450a82 (diff)
downloadtanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.gz
tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.tar.bz2
tanzanite-46d087e17a549a3b1bb9797714d5c3df440b67f5.zip
moderation changes + appeals progress
Diffstat (limited to 'src/commands/moderation/unblock.ts')
-rw-r--r--src/commands/moderation/unblock.ts32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/commands/moderation/unblock.ts b/src/commands/moderation/unblock.ts
index 4fdfc28..70bf530 100644
--- a/src/commands/moderation/unblock.ts
+++ b/src/commands/moderation/unblock.ts
@@ -2,17 +2,15 @@ import {
AllowedMentions,
BotCommand,
emojis,
- format,
+ formatUnblockResponse,
Moderation,
- unblockResponse,
type ArgType,
type CommandMessage,
type OptArgType,
- type SlashMessage,
- type UnblockResponse
+ type SlashMessage
} from '#lib';
import assert from 'assert/strict';
-import { ApplicationCommandOptionType, type GuildMember } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord.js';
export default class UnblockCommand extends BotCommand {
public constructor() {
@@ -94,30 +92,8 @@ export default class UnblockCommand extends BotCommand {
});
return await message.util.reply({
- content: UnblockCommand.formatCode(member, responseCode),
+ content: formatUnblockResponse(member, responseCode),
allowedMentions: AllowedMentions.none()
});
}
-
- public static formatCode(member: GuildMember, code: UnblockResponse): string {
- const victim = format.input(member.user.tag);
- switch (code) {
- case unblockResponse.MISSING_PERMISSIONS:
- return `${emojis.error} Could not unblock ${victim} because I am missing the **Manage Channel** permission.`;
- case unblockResponse.INVALID_CHANNEL:
- return `${emojis.error} Could not unblock ${victim}, you can only unblock users in text or thread channels.`;
- case unblockResponse.ACTION_ERROR:
- return `${emojis.error} An unknown error occurred while trying to unblock ${victim}.`;
- case unblockResponse.MODLOG_ERROR:
- return `${emojis.error} There was an error creating a modlog entry, please report this to my developers.`;
- case unblockResponse.PUNISHMENT_ENTRY_REMOVE_ERROR:
- return `${emojis.error} There was an error creating a punishment entry, please report this to my developers.`;
- case unblockResponse.DM_ERROR:
- return `${emojis.warn} Unblocked ${victim} however I could not send them a dm.`;
- case unblockResponse.SUCCESS:
- return `${emojis.success} Successfully unblocked ${victim}.`;
- default:
- return `${emojis.error} An error occurred: ${format.input(code)}}`;
- }
- }
}