20 lines
702 B
TypeScript
20 lines
702 B
TypeScript
// Metro module 4680 (f4681).
|
|
import { GUILD_NON_CATEGORY_CHANNEL_TYPES } from "../../records/ChannelRecord";
|
|
import { Permissions } from "../../_bundle/Module505";
|
|
import { canEveryoneRole } from "../../utils/PermissionUtils";
|
|
import { has } from "../../_bundle/HighLow";
|
|
export default function isRoleRequired(a0) {
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
const type = a0.type;
|
|
if (a0.guild_id != null && GUILD_NON_CATEGORY_CHANNEL_TYPES.has(type)) {
|
|
if (a0.isGuildVocal() && !canEveryoneRole(Permissions.CONNECT, a0)) {
|
|
return true;
|
|
}
|
|
const r22 = a0.permissionOverwrites[a0.guild_id];
|
|
return r22 != null && has(r22.deny, Permissions.VIEW_CHANNEL);
|
|
}
|
|
return false;
|
|
};
|