3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 21:17:19 +00:00
zeppelin/backend/src/utils/canReadChannel.ts

8 lines
435 B
TypeScript

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);
}