diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/commands/moderation/mute.ts | |
parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/commands/moderation/mute.ts')
-rw-r--r-- | src/commands/moderation/mute.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 40e13e7..ea935ce 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -9,6 +9,7 @@ import { type OptionalArgType } from '#lib'; import assert from 'assert'; +import { ApplicationCommandOptionType, Permissions } from 'discord.js'; export default class MuteCommand extends BushCommand { public constructor() { @@ -25,7 +26,7 @@ export default class MuteCommand extends BushCommand { type: 'user', prompt: 'What user would you like to mute?', retry: '{error} Choose a valid user to mute.', - slashType: 'USER' + slashType: ApplicationCommandOptionType.User }, { id: 'reason_and_duration', @@ -35,7 +36,7 @@ export default class MuteCommand extends BushCommand { prompt: 'Why should this user be muted and for how long?', retry: '{error} Choose a valid mute reason and duration.', optional: true, - slashType: 'STRING' + slashType: ApplicationCommandOptionType.String }, { id: 'force', @@ -50,8 +51,8 @@ export default class MuteCommand extends BushCommand { ], slash: true, channel: 'guild', - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_ROLES']), - userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES']) + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_ROLES]), + userPermissions: (m) => util.userGuildPermCheck(m, [Permissions.FLAGS.MANAGE_MESSAGES]) }); } @@ -118,6 +119,8 @@ export default class MuteCommand extends BushCommand { return `${util.emojis.warn} Muted ${victim} however I could not send them a dm.`; case muteResponse.SUCCESS: return `${util.emojis.success} Successfully muted ${victim}.`; + default: + return `${util.emojis.error} An error occurred: ${util.format.input(responseCode)}}`; } }; return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() }); |