aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/block.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/block.ts')
-rw-r--r--src/commands/moderation/block.ts30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/commands/moderation/block.ts b/src/commands/moderation/block.ts
index da1dec8..989eb39 100644
--- a/src/commands/moderation/block.ts
+++ b/src/commands/moderation/block.ts
@@ -1,19 +1,17 @@
import {
AllowedMentions,
- blockResponse,
BotCommand,
castDurationContent,
emojis,
- format,
+ formatBlockResponse,
Moderation,
type ArgType,
- type BlockResponse,
type CommandMessage,
type OptArgType,
type SlashMessage
} from '#lib';
import assert from 'assert/strict';
-import { ApplicationCommandOptionType, type GuildMember } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord.js';
export default class BlockCommand extends BotCommand {
public constructor() {
@@ -97,30 +95,8 @@ export default class BlockCommand extends BotCommand {
});
return await message.util.reply({
- content: BlockCommand.formatCode(member, responseCode),
+ content: formatBlockResponse(member, responseCode),
allowedMentions: AllowedMentions.none()
});
}
-
- public static formatCode(member: GuildMember, code: BlockResponse): string {
- const victim = format.input(member.user.tag);
- switch (code) {
- case blockResponse.MISSING_PERMISSIONS:
- return `${emojis.error} Could not block ${victim} because I am missing the **Manage Channel** permission.`;
- case blockResponse.INVALID_CHANNEL:
- return `${emojis.error} Could not block ${victim}, you can only block users in text or thread channels.`;
- case blockResponse.ACTION_ERROR:
- return `${emojis.error} An unknown error occurred while trying to block ${victim}.`;
- case blockResponse.MODLOG_ERROR:
- return `${emojis.error} There was an error creating a modlog entry, please report this to my developers.`;
- case blockResponse.PUNISHMENT_ENTRY_ADD_ERROR:
- return `${emojis.error} There was an error creating a punishment entry, please report this to my developers.`;
- case blockResponse.DM_ERROR:
- return `${emojis.warn} Blocked ${victim} however I could not send them a dm.`;
- case blockResponse.SUCCESS:
- return `${emojis.success} Successfully blocked ${victim}.`;
- default:
- return `${emojis.error} An error occurred: ${format.input(code)}}`;
- }
- }
}