3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

More work on permission utils and eager permission checks

This commit is contained in:
Dragory 2020-08-07 01:21:31 +03:00
parent 8af64a6944
commit 6d4a7cdafd
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
11 changed files with 189 additions and 79 deletions

View file

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