decord/source/modules/guild_automod/PermissionUtils.tsx

73 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 15897
// Function ID: 15898
2026-07-29 08:29:29 +00:00
// Name: canCurrentUserManageMessageFilters
2026-08-07 06:50:47 +00:00
// Dependencies: [1891, 3929, 676, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: canCurrentUserManageAutomod, canCurrentUserManageMessageFilters, useCanCurrentUserManageAutomod, useIsUserProfileRuleEnabled
2026-08-08 06:10:11 +00:00
// Module 15897 (canCurrentUserManageMessageFilters)
2026-07-29 08:29:29 +00:00
import createGuildRecordFromRust from "createGuildRecordFromRust";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ GuildFeatures: c4, Permissions: c5 } = ME);
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("modules/guild_automod/PermissionUtils.tsx");
2026-07-20 16:05:17 +00:00
export const canCurrentUserManageMessageFilters = function canCurrentUserManageMessageFilters(guild_id) {
let tmp = null != guild_id;
if (tmp) {
2026-07-29 08:29:29 +00:00
const guild = store.getGuild(guild_id);
let canResult = null != guild;
if (canResult) {
canResult = obj.can(constants.MANAGE_GUILD, guild);
}
tmp = canResult;
obj = getUncachedChannelPermissions;
2026-07-20 16:05:17 +00:00
}
return tmp;
};
2026-07-29 08:29:29 +00:00
export const canCurrentUserManageAutomod = function canCurrentUserManageAutomod(arg0) {
const guild = store.getGuild(arg0);
let canResult = null != guild;
if (canResult) {
canResult = getUncachedChannelPermissions.can(constants.MANAGE_GUILD, guild);
}
return canResult;
2026-07-20 16:05:17 +00:00
};
export const useCanCurrentUserManageAutomod = function useCanCurrentUserManageAutomod(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
const items = [createGuildRecordFromRust, getUncachedChannelPermissions];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
if (outer1_2 !== undefined) {
if (obj2 !== undefined) {
const guild = outer1_2.getGuild(tmp);
let canResult = null != guild;
if (canResult) {
canResult = obj2.can(outer1_5.MANAGE_GUILD, guild);
}
return canResult;
}
}
}, items1);
2026-07-20 16:05:17 +00:00
};
export const useIsUserProfileRuleEnabled = function useIsUserProfileRuleEnabled(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
const items = [createGuildRecordFromRust];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
const guild = outer1_2.getGuild(closure_0);
2026-07-20 16:05:17 +00:00
let flag;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-07-23 10:11:24 +00:00
flag = features.has(outer1_4.COMMUNITY);
2026-07-20 16:05:17 +00:00
}
if (!flag) {
flag = false;
}
return flag;
}, items1);
};