diff options
Diffstat (limited to 'src/commands/moderation/kick.ts')
-rw-r--r-- | src/commands/moderation/kick.ts | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index d757e91..e4aebbd 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -2,17 +2,15 @@ import { AllowedMentions, BotCommand, emojis, - format, - kickResponse, + formatKickResponse, Moderation, type ArgType, type CommandMessage, - type KickResponse, 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 KickCommand extends BotCommand { public constructor() { @@ -82,26 +80,8 @@ export default class KickCommand extends BotCommand { }); return await message.util.reply({ - content: KickCommand.formatCode(member, responseCode), + content: formatKickResponse(member, responseCode), allowedMentions: AllowedMentions.none() }); } - - public static formatCode(member: GuildMember, code: KickResponse): string { - const victim = format.input(member.user.tag); - switch (code) { - case kickResponse.MISSING_PERMISSIONS: - return `${emojis.error} Could not kick ${victim} because I am missing the **Kick Members** permission.`; - case kickResponse.ACTION_ERROR: - return `${emojis.error} An error occurred while trying to kick ${victim}.`; - case kickResponse.MODLOG_ERROR: - return `${emojis.error} While muting ${victim}, there was an error creating a modlog entry, please report this to my developers.`; - case kickResponse.DM_ERROR: - return `${emojis.warn} Kicked ${victim} however I could not send them a dm.`; - case kickResponse.SUCCESS: - return `${emojis.success} Successfully kicked ${victim}.`; - default: - return `${emojis.error} An error occurred: ${format.input(code)}}`; - } - } } |