3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 15:30:00 +00:00
zeppelin/backend/src/utils/canReadChannel.ts

9 lines
458 B
TypeScript
Raw Normal View History

import { GuildMember, GuildTextBasedChannel } from "discord.js";
import { getMissingChannelPermissions } from "./getMissingChannelPermissions";
import { readChannelPermissions } from "./readChannelPermissions";
export function canReadChannel(channel: GuildTextBasedChannel, member: GuildMember) {
// Not missing permissions required to read the channel = can read channel
return !getMissingChannelPermissions(member, channel, readChannelPermissions);
}