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

!source: don't show source of messages you don't have access to; allow mods to use the command by default

This commit is contained in:
Dragory 2020-08-05 23:57:09 +03:00
parent 14af94e7a3
commit 60aff76ebe
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
6 changed files with 137 additions and 12 deletions

View file

@ -0,0 +1,10 @@
import { Constants, GuildChannel } from "eris";
import { hasPermissions } from "./hasPermissions";
export function canReadChannel(channel: GuildChannel, memberId: string) {
const channelPermissions = channel.permissionsOf(memberId);
return hasPermissions(channelPermissions, [
Constants.Permissions.readMessages,
Constants.Permissions.readMessageHistory,
]);
}