Gateway permission check fix
This commit is contained in:
@@ -5,6 +5,7 @@ import { EVENT, Event } from "../interfaces";
|
||||
const events = new EventEmitter();
|
||||
|
||||
export async function emitEvent(payload: Omit<Event, "created_at">) {
|
||||
console.log(payload) //TODO remove before merge
|
||||
const id = (payload.channel_id || payload.user_id || payload.guild_id) as string;
|
||||
if (!id) return console.error("event doesn't contain any id", payload);
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ export class Permissions extends BitField {
|
||||
}
|
||||
|
||||
overwriteChannel(overwrites: ChannelPermissionOverwrite[]) {
|
||||
if (!overwrites) return this
|
||||
if (!this.cache) throw new Error("permission chache not available");
|
||||
overwrites = overwrites.filter((x) => {
|
||||
if (x.type === 0 && this.cache.roles?.some((r) => r.id === x.id)) return true;
|
||||
|
||||
Reference in New Issue
Block a user