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/ban.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/ban.ts')
-rw-r--r-- | src/commands/moderation/ban.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index aeb03f0..33f980d 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -8,7 +8,7 @@ import { type BushSlashMessage, type OptionalArgType } from '#lib'; -import { type User } from 'discord.js'; +import { ApplicationCommandOptionType, Permissions, type User } from 'discord.js'; export default class BanCommand extends BushCommand { public constructor() { @@ -25,7 +25,7 @@ export default class BanCommand extends BushCommand { type: util.arg.union('user', 'snowflake'), prompt: 'What user would you like to ban?', retry: '{error} Choose a valid user to ban.', - slashType: 'USER' + slashType: ApplicationCommandOptionType.User }, { id: 'reason_and_duration', @@ -34,7 +34,7 @@ export default class BanCommand extends BushCommand { match: 'rest', prompt: 'Why should this user be banned and for how long?', retry: '{error} Choose a valid ban reason and duration.', - slashType: 'STRING', + slashType: ApplicationCommandOptionType.String, optional: true }, { @@ -46,7 +46,7 @@ export default class BanCommand extends BushCommand { retry: '{error} Choose between 0 and 7 days to delete messages from the user for.', type: util.arg.range('integer', 0, 7, true), optional: true, - slashType: 'INTEGER', + slashType: ApplicationCommandOptionType.Integer, choices: [...Array(8).keys()].map((v) => ({ name: v.toString(), value: v })) }, { @@ -62,8 +62,8 @@ export default class BanCommand extends BushCommand { ], slash: true, channel: 'guild', - clientPermissions: ['BAN_MEMBERS'], - userPermissions: ['BAN_MEMBERS'] + clientPermissions: [Permissions.FLAGS.BAN_MEMBERS], + userPermissions: [Permissions.FLAGS.BAN_MEMBERS] }); } @@ -141,6 +141,8 @@ export default class BanCommand extends BushCommand { return `${util.emojis.warn} Banned ${victim} however I could not send them a dm.`; case banResponse.SUCCESS: return `${util.emojis.success} Successfully banned ${victim}.`; + default: + return `${util.emojis.error} An error occurred: ${util.format.input(responseCode)}}`; } }; return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() }); |