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.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/commands/moderation/block.ts b/src/commands/moderation/block.ts
index 57f909a..0b6458d 100644
--- a/src/commands/moderation/block.ts
+++ b/src/commands/moderation/block.ts
@@ -11,6 +11,7 @@ import {
type OptionalArgType
} from '#lib';
import assert from 'assert';
+import { ApplicationCommandOptionType, Permissions } from 'discord.js';
export default class BlockCommand extends BushCommand {
public constructor() {
@@ -27,7 +28,7 @@ export default class BlockCommand extends BushCommand {
type: 'user',
prompt: 'What user would you like to block?',
retry: '{error} Choose a valid user to block.',
- slashType: 'USER'
+ slashType: ApplicationCommandOptionType.User
},
{
id: 'reason_and_duration',
@@ -37,7 +38,7 @@ export default class BlockCommand extends BushCommand {
prompt: 'Why should this user be blocked and for how long?',
retry: '{error} Choose a valid block reason and duration.',
optional: true,
- slashType: 'STRING'
+ slashType: ApplicationCommandOptionType.String
},
{
id: 'force',
@@ -52,8 +53,8 @@ export default class BlockCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m, 'MANAGE_CHANNELS'),
- userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES'])
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_CHANNELS]),
+ userPermissions: (m) => util.userGuildPermCheck(m, [Permissions.FLAGS.MANAGE_MESSAGES])
});
}
@@ -120,6 +121,8 @@ export default class BlockCommand extends BushCommand {
return `${util.emojis.warn} Blocked ${victim} however I could not send them a dm.`;
case blockResponse.SUCCESS:
return `${util.emojis.success} Successfully blocked ${victim}.`;
+ default:
+ return `${util.emojis.error} An error occurred: ${util.format.input(responseCode)}}`;
}
};
return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });