mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-08 03:42:34 +01:00
🐛 fix Message Model
This commit is contained in:
parent
101cdae287
commit
a85d65dadf
@ -126,7 +126,7 @@ export interface Reaction {
|
|||||||
count: number;
|
count: number;
|
||||||
//// not saved in the database // me: boolean; // whether the current user reacted using this emoji
|
//// not saved in the database // me: boolean; // whether the current user reacted using this emoji
|
||||||
emoji: PartialEmoji;
|
emoji: PartialEmoji;
|
||||||
user_ids?: string[];
|
user_ids: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PartialEmoji {
|
export interface PartialEmoji {
|
||||||
|
@ -98,7 +98,7 @@ export class Permissions extends BitField {
|
|||||||
};
|
};
|
||||||
|
|
||||||
any(permission: PermissionResolvable, checkAdmin = true) {
|
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.
|
* 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) {
|
hasThrow(permission: PermissionResolvable) {
|
||||||
if (this.has(permission)) return true;
|
if (this.has(permission) && this.has("VIEW_CHANNEL")) return true;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
throw new HTTPError(`You are missing the following permissions ${permission}`, 403);
|
throw new HTTPError(`You are missing the following permissions ${permission}`, 403);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user