Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
128 lines
4.1 KiB
TypeScript
128 lines
4.1 KiB
TypeScript
// Module ID: 16899
|
|
// Function ID: 16900
|
|
// Name: guild_automod/PermissionUtils
|
|
// Dependencies: [2066, 4498, 11554, 1074, 504, 2]
|
|
// Exports: canCurrentUserManageAutomod, canCurrentUserManageMessageFilters, hasMentionRaidLimitAccess, useCanCurrentUserManageAutomod, useHasMentionRaidLimitAccess, useIsUndeletableMentionSpamRule, useIsUserProfileRuleEnabled
|
|
|
|
// Module 16899 (guild_automod/PermissionUtils)
|
|
import GuildStore from "GuildStore" /* 2066 */;
|
|
import PermissionStore from "PermissionStore" /* 4498 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
const require = fn;
|
|
const AutomodTriggerType = fn(11554).AutomodTriggerType;
|
|
const Constants = fn(1074);
|
|
({ GuildFeatures: hasOwnProperty, Permissions: metroRequire } = Constants);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_automod/PermissionUtils.tsx");
|
|
|
|
export const canCurrentUserManageMessageFilters = function canCurrentUserManageMessageFilters(guild_id) {
|
|
let tmp = null != guild_id;
|
|
if (tmp) {
|
|
const guild = GuildStore.getGuild(guild_id);
|
|
let canResult = null != guild;
|
|
if (canResult) {
|
|
canResult = obj.can(constants2.MANAGE_GUILD, guild);
|
|
}
|
|
tmp = canResult;
|
|
obj = PermissionStore;
|
|
}
|
|
return tmp;
|
|
};
|
|
export const canCurrentUserManageAutomod = function canCurrentUserManageAutomod(arg0) {
|
|
const guild = GuildStore.getGuild(arg0);
|
|
let canResult = null != guild;
|
|
if (canResult) {
|
|
canResult = PermissionStore.can(constants2.MANAGE_GUILD, guild);
|
|
}
|
|
return canResult;
|
|
};
|
|
export const useCanCurrentUserManageAutomod = function useCanCurrentUserManageAutomod(arg0) {
|
|
_require = arg0;
|
|
const items = [GuildStore, PermissionStore];
|
|
const items1 = [arg0];
|
|
return require("initialize").useStateFromStores(items, () => {
|
|
if (GuildStore !== undefined) {
|
|
if (obj2 !== undefined) {
|
|
const guild = GuildStore.getGuild(tmp);
|
|
let canResult = null != guild;
|
|
if (canResult) {
|
|
canResult = obj2.can(constants2.MANAGE_GUILD, guild);
|
|
}
|
|
return canResult;
|
|
}
|
|
}
|
|
}, items1);
|
|
};
|
|
export const hasMentionRaidLimitAccess = function hasMentionRaidLimitAccess(guildId) {
|
|
let obj = arg1;
|
|
if (arg1 === undefined) {
|
|
obj = GuildStore;
|
|
}
|
|
const guild = obj.getGuild(guildId);
|
|
let flag;
|
|
if (guild != null) {
|
|
const features = guild.features;
|
|
flag = features.has(constants.COMMUNITY);
|
|
}
|
|
if (flag == null) {
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
};
|
|
export const useHasMentionRaidLimitAccess = function useHasMentionRaidLimitAccess(guildId) {
|
|
_require = guildId;
|
|
const items = [GuildStore];
|
|
const items1 = [guildId];
|
|
return require("initialize").useStateFromStores(items, () => {
|
|
if (GuildStore !== undefined) {
|
|
const guild = GuildStore.getGuild(tmp);
|
|
let flag;
|
|
if (guild != null) {
|
|
const features = guild.features;
|
|
flag = features.has(constants.COMMUNITY);
|
|
}
|
|
if (flag == null) {
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}
|
|
}, items1);
|
|
};
|
|
export const useIsUndeletableMentionSpamRule = function useIsUndeletableMentionSpamRule(guildId, triggerType) {
|
|
_require = guildId;
|
|
dependencyMap = triggerType;
|
|
const items = [GuildStore];
|
|
const items1 = [guildId, triggerType];
|
|
return require("initialize").useStateFromStores(items, () => {
|
|
if (closure_1 !== AutomodTriggerType.MENTION_SPAM) {
|
|
return false;
|
|
} else {
|
|
const guild = GuildStore.getGuild(closure_0);
|
|
let hasItem = null != guild;
|
|
if (hasItem) {
|
|
const features = guild.features;
|
|
hasItem = features.has(constants.COMMUNITY);
|
|
}
|
|
return hasItem;
|
|
}
|
|
}, items1);
|
|
};
|
|
export const useIsUserProfileRuleEnabled = function useIsUserProfileRuleEnabled(guildId) {
|
|
_require = guildId;
|
|
const items = [GuildStore];
|
|
const items1 = [guildId];
|
|
return require("initialize").useStateFromStores(items, () => {
|
|
const guild = GuildStore.getGuild(closure_0);
|
|
let flag;
|
|
if (guild != null) {
|
|
const features = guild.features;
|
|
flag = features.has(constants.COMMUNITY);
|
|
}
|
|
if (!flag) {
|
|
flag = false;
|
|
}
|
|
return flag;
|
|
}, items1);
|
|
};
|