aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/unban.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/unban.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/unban.ts')
-rw-r--r--src/commands/moderation/unban.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts
index c939792..b2bdd72 100644
--- a/src/commands/moderation/unban.ts
+++ b/src/commands/moderation/unban.ts
@@ -7,6 +7,7 @@ import {
type BushSlashMessage,
type OptionalArgType
} from '#lib';
+import { ApplicationCommandOptionType, Permissions } from 'discord.js';
export default class UnbanCommand extends BushCommand {
public constructor() {
@@ -23,7 +24,7 @@ export default class UnbanCommand extends BushCommand {
type: 'globalUser',
prompt: 'What user would you like to unban?',
retry: '{error} Choose a valid user to unban.',
- slashType: 'USER'
+ slashType: ApplicationCommandOptionType.User
},
{
id: 'reason',
@@ -33,15 +34,16 @@ export default class UnbanCommand extends BushCommand {
prompt: 'Why should this user be unbanned?',
retry: '{error} Choose a valid unban reason.',
optional: true,
- slashType: 'STRING'
+ slashType: ApplicationCommandOptionType.String
}
],
slash: true,
channel: 'guild',
- clientPermissions: ['BAN_MEMBERS'],
- userPermissions: ['BAN_MEMBERS']
+ clientPermissions: [Permissions.FLAGS.BAN_MEMBERS],
+ userPermissions: [Permissions.FLAGS.BAN_MEMBERS]
});
}
+
public override async exec(
message: BushMessage | BushSlashMessage,
{ user, reason }: { user: ArgType<'user'>; reason: OptionalArgType<'string'> }
@@ -68,6 +70,8 @@ export default class UnbanCommand extends BushCommand {
case unbanResponse.DM_ERROR:
case unbanResponse.SUCCESS:
return `${util.emojis.success} Successfully unbanned ${victim}.`;
+ default:
+ return `${util.emojis.error} An error occurred: ${util.format.input(responseCode)}}`;
}
};
return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });