function channelOverwriteHasPermission(
  guildId,
  id,
  overwrites,
  permissions,
) {
  const overwrite = overwrites.find((perm) => perm.id === id) ||
    overwrites.find((perm) => perm.id === guildId);
  if (!overwrite) return false;
  return permissions.every((perm) => {
    const allowBits = overwrite.allow;
    const denyBits = overwrite.deny;
    if (BigInt(denyBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
      return false;
    }
    if (BigInt(allowBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
      return true;
    }
  });
}
/** Checks if a channel overwrite for a user id or a role id has permission in this channel */
Checks if a channel overwrite for a user id or a role id has permission in this channel
Checks if a channel overwrite for a user id or a role id has permission in this channel
function channelOverwriteHasPermission(
  guildId,
  id,
  overwrites,
  permissions,
) {
  const overwrite = overwrites.find((perm) => perm.id === id) ||
    overwrites.find((perm) => perm.id === guildId);
  if (!overwrite) return false;
  return permissions.every((perm) => {
    const allowBits = overwrite.allow;
    const denyBits = overwrite.deny;
    if (BigInt(denyBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
      return false;
    }
    if (BigInt(allowBits) & BigInt(DiscordBitwisePermissionFlags[perm])) {
      return true;
    }
  });
}
function channelOverwriteHasPermission ( guildId , id , overwrites , permissions , ) { const overwrite = overwrites . find ( ( perm ) => perm . id === id ) || overwrites . find ( ( perm ) => perm . id === guildId ) ; if ( ! overwrite ) return false ; return permissions . every ( ( perm ) => { const allowBits = overwrite . allow ; const denyBits = overwrite . deny ; if ( BigInt ( denyBits ) & BigInt ( DiscordBitwisePermissionFlags [ perm ] ) ) { return false ; } if ( BigInt ( allowBits ) & BigInt ( DiscordBitwisePermissionFlags [ perm ] ) ) { return true ; } } ) ; }
Checks if a channel overwrite for a user id or a role id has permission in this channel
Checks if a channel overwrite for a user id or a role id has permission in this channel