3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +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 39215c1348
commit 4b062f6d23
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,
]);
}