summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-22 17:40:45 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-22 17:40:45 +0200
commita85d65dadf0841f9a850103bdb196f28576a628d (patch)
tree97d424eea10b30802f71c61cab7c34eb32172ea7
parent1.2.4 (diff)
downloadserver-a85d65dadf0841f9a850103bdb196f28576a628d.tar.xz
:bug: fix Message Model
-rw-r--r--src/models/Message.ts2
-rw-r--r--src/util/Permissions.ts6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/models/Message.ts b/src/models/Message.ts

index de32e6a7..77d67a9a 100644 --- a/src/models/Message.ts +++ b/src/models/Message.ts
@@ -126,7 +126,7 @@ export interface Reaction { count: number; //// not saved in the database // me: boolean; // whether the current user reacted using this emoji emoji: PartialEmoji; - user_ids?: string[]; + user_ids: string[]; } export interface PartialEmoji { 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); }