aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/untimeout.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-23 18:13:05 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-23 18:13:05 -0500
commita3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch)
tree9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/commands/moderation/untimeout.ts
parent5557677f1570eb564a30cfcebb6030235dc84d47 (diff)
downloadtanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz
tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2
tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/commands/moderation/untimeout.ts')
-rw-r--r--src/commands/moderation/untimeout.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/commands/moderation/untimeout.ts b/src/commands/moderation/untimeout.ts
index c5518b4..6ebd777 100644
--- a/src/commands/moderation/untimeout.ts
+++ b/src/commands/moderation/untimeout.ts
@@ -9,6 +9,7 @@ import {
type OptionalArgType
} from '#lib';
import assert from 'assert';
+import { ApplicationCommandOptionType, Permissions } from 'discord.js';
export default class UntimeoutCommand extends BushCommand {
public constructor() {
@@ -25,7 +26,7 @@ export default class UntimeoutCommand extends BushCommand {
type: 'user',
prompt: 'What user would you like to untimeout?',
retry: '{error} Choose a valid user to untimeout.',
- slashType: 'USER'
+ slashType: ApplicationCommandOptionType.User
},
{
id: 'reason',
@@ -34,7 +35,7 @@ export default class UntimeoutCommand extends BushCommand {
match: 'rest',
prompt: 'Why should this user have their timeout removed?',
retry: '{error} Choose a valid reason to remove the timeout.',
- slashType: 'STRING',
+ slashType: ApplicationCommandOptionType.String,
optional: true
},
{
@@ -50,8 +51,8 @@ export default class UntimeoutCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MODERATE_MEMBERS']),
- userPermissions: ['MODERATE_MEMBERS']
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MODERATE_MEMBERS]),
+ userPermissions: [Permissions.FLAGS.MODERATE_MEMBERS]
});
}
@@ -92,6 +93,8 @@ export default class UntimeoutCommand extends BushCommand {
return `${util.emojis.warn} Removed ${victim}'s timeout however I could not send them a dm.`;
case removeTimeoutResponse.SUCCESS:
return `${util.emojis.success} Successfully removed ${victim}'s timeout.`;
+ default:
+ return `${util.emojis.error} An error occurred: ${util.format.input(responseCode)}}`;
}
};
return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });