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/admin/channelPermissions.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/admin/channelPermissions.ts')
-rw-r--r-- | src/commands/admin/channelPermissions.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index 026f1a6..f0d2c65 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -1,5 +1,5 @@ import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbed } from 'discord.js'; +import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; export default class ChannelPermissionsCommand extends BushCommand { public constructor() { @@ -18,7 +18,7 @@ export default class ChannelPermissionsCommand extends BushCommand { readableType: 'member|role', prompt: 'What user/role would you like to change?', retry: '{error} Choose a valid user/role to change.', - slashType: 'MENTIONABLE' + slashType: ApplicationCommandOptionType.Mentionable }, { id: 'permission', @@ -26,7 +26,7 @@ export default class ChannelPermissionsCommand extends BushCommand { type: 'permission', prompt: 'What permission would you like to change?', retry: '{error} Choose a valid permission.', - slashType: 'STRING' + slashType: ApplicationCommandOptionType.String }, { id: 'state', @@ -39,7 +39,7 @@ export default class ChannelPermissionsCommand extends BushCommand { readableType: "'enable'|'disable'|'remove'", prompt: 'What should that permission be set to?', retry: '{error} Set the state to either `enable`, `disable`, or `remove`.', - slashType: 'STRING', + slashType: ApplicationCommandOptionType.String, choices: [ { name: 'Enabled', value: 'true' }, { name: 'Disabled', value: 'false' }, @@ -47,8 +47,8 @@ export default class ChannelPermissionsCommand extends BushCommand { ] } ], - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']), - userPermissions: ['ADMINISTRATOR'], + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_CHANNELS]), + userPermissions: [Permissions.FLAGS.ADMINISTRATOR], channel: 'guild', slash: true }); @@ -63,7 +63,7 @@ export default class ChannelPermissionsCommand extends BushCommand { } ) { if (!message.inGuild()) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); - if (!message.member!.permissions.has('ADMINISTRATOR') && !message.member!.user.isOwner()) + if (!message.member!.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && !message.member!.user.isOwner()) return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`); if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); |