3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 23:09:59 +00:00
zeppelin/backend/src/utils/canReadChannel.ts

9 lines
435 B
TypeScript
Raw Normal View History

import { Constants, GuildChannel, Member } from "eris";
import { readChannelPermissions } from "./readChannelPermissions";
import { getMissingChannelPermissions } from "./getMissingChannelPermissions";
export function canReadChannel(channel: GuildChannel, member: Member) {
// Not missing permissions required to read the channel = can read channel
return !getMissingChannelPermissions(member, channel, readChannelPermissions);
}