From a85d65dadf0841f9a850103bdb196f28576a628d Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 22 May 2021 17:40:45 +0200 Subject: :bug: fix Message Model --- src/util/Permissions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/Permissions.ts b/src/util/Permissions.ts index b2af93e0..e454bf00 100644 --- a/src/util/Permissions.ts +++ b/src/util/Permissions.ts @@ -98,7 +98,7 @@ export class Permissions extends BitField { }; any(permission: PermissionResolvable, checkAdmin = true) { - return (checkAdmin && super.has(Permissions.FLAGS.ADMINISTRATOR)) || super.any(permission); + return (checkAdmin && super.any(Permissions.FLAGS.ADMINISTRATOR)) || super.any(permission); } /** @@ -111,8 +111,8 @@ export class Permissions extends BitField { /** * Checks whether the bitfield has a permission, or multiple permissions, but throws an Error if user fails to match auth criteria. */ - hasThrow(permission: PermissionResolvable, checkAdmin = true) { - if (this.has(permission)) return true; + hasThrow(permission: PermissionResolvable) { + if (this.has(permission) && this.has("VIEW_CHANNEL")) return true; // @ts-ignore throw new HTTPError(`You are missing the following permissions ${permission}`, 403); } -- cgit 1.5.1