aboutsummaryrefslogtreecommitdiff
path: root/src/commands/admin/channelPermissions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/admin/channelPermissions.ts')
-rw-r--r--src/commands/admin/channelPermissions.ts22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index f6240a5..12245a9 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -1,4 +1,14 @@
-import { BushCommand, ButtonPaginator, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
+import {
+ Arg,
+ BushCommand,
+ ButtonPaginator,
+ clientSendAndPermCheck,
+ emojis,
+ formatError,
+ type ArgType,
+ type CommandMessage,
+ type SlashMessage
+} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
@@ -15,7 +25,7 @@ export default class ChannelPermissionsCommand extends BushCommand {
{
id: 'target',
description: 'The user/role to change the permissions of.',
- type: util.arg.union('member', 'role'),
+ type: Arg.union('member', 'role'),
readableType: 'member|role',
prompt: 'What user/role would you like to change?',
retry: '{error} Choose a valid user/role to change.',
@@ -48,7 +58,7 @@ export default class ChannelPermissionsCommand extends BushCommand {
]
}
],
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageChannels]),
+ clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.ManageChannels]),
userPermissions: [PermissionFlagsBits.Administrator],
channel: 'guild',
slash: true,
@@ -64,9 +74,9 @@ export default class ChannelPermissionsCommand extends BushCommand {
if (message.util.isSlashMessage(message)) await message.interaction.deferReply();
const permission = message.util.isSlashMessage(message)
- ? await util.arg.cast('permission', message, args.permission)
+ ? await Arg.cast('permission', message, args.permission)
: args.permission;
- if (!permission) return await message.util.reply(`${util.emojis.error} Invalid permission.`);
+ if (!permission) return await message.util.reply(`${emojis.error} Invalid permission.`);
const failedChannels = [];
for (const [, channel] of message.guild.channels.cache) {
try {
@@ -79,7 +89,7 @@ export default class ChannelPermissionsCommand extends BushCommand {
{ reason: 'Changing overwrites for mass channel perms command' }
);
} catch (e) {
- void client.console.error('channelPermissions', util.formatError(e, false));
+ void client.console.error('channelPermissions', formatError(e, false));
failedChannels.push(channel);
}
}