From e78beed6c7e094ef48aad5d18da01b2bbed4536c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 19 Feb 2022 18:52:41 -0500 Subject: fix: a ton of shit --- src/commands/admin/channelPermissions.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/commands/admin') diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index e12a131..37610b3 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -1,4 +1,5 @@ import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import assert from 'assert'; import { ApplicationCommandOptionType, Embed, PermissionFlagsBits } from 'discord.js'; export default class ChannelPermissionsCommand extends BushCommand { @@ -62,9 +63,7 @@ export default class ChannelPermissionsCommand extends BushCommand { state: 'true' | 'false' | 'neutral'; } ) { - 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(PermissionFlagsBits.Administrator) && !message.member!.user.isOwner()) - return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`); + assert(message.inGuild()); if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); const permission = message.util.isSlashMessage(message) @@ -72,7 +71,7 @@ export default class ChannelPermissionsCommand extends BushCommand { : args.permission; if (!permission) return await message.util.reply(`${util.emojis.error} Invalid permission.`); const failedChannels = []; - for (const [, channel] of message.guild!.channels.cache) { + for (const [, channel] of message.guild.channels.cache) { try { if (channel.isThread()) return; if (channel.permissionsLocked) return; -- cgit