decord/source/utils/ChatRestrictions.tsx

76 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 10396
// Function ID: 10397
// Name: ChatRestrictions
// Dependencies: [1074, 10397, 1115, 2]
2026-07-23 10:11:24 +00:00
// Module 10396 (ChatRestrictions)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1115 */;
import MentionGuardUtilsDefault from "MentionGuardUtils" /* 10397 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
const TOKEN_REGEX = Constants.TOKEN_REGEX;
2026-07-29 08:29:29 +00:00
const items = [
{
check(arg0, getGuildId, arg2) {
2026-07-29 08:29:29 +00:00
if (arg2) {
if (null == getGuildId.getGuildId()) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const extractEveryoneRoleResult = MentionGuardUtilsDefault.extractEveryoneRole(arg0, getGuildId);
2026-07-29 08:29:29 +00:00
if (null == extractEveryoneRoleResult) {
2026-07-20 16:05:17 +00:00
return false;
2026-07-29 08:29:29 +00:00
} else {
if (tmp9Result.shouldShowEveryoneGuard(extractEveryoneRoleResult, getGuildId)) {
const everyoneMemberCountResult = tmp9(10397).everyoneMemberCount(extractEveryoneRoleResult, getGuildId);
2026-07-29 08:29:29 +00:00
const _Math = Math;
const _Math2 = Math;
const _Math3 = Math;
const powResult = Math.pow(10, Math.floor(Math.log10(everyoneMemberCountResult)));
let v47E5Rz = util.t["47E5Rz"];
2026-07-29 08:29:29 +00:00
if (getGuildId.isForumPost()) {
v47E5Rz = tmp6(1115).t.sYW2cy;
2026-07-29 08:29:29 +00:00
} else if (getGuildId.isThread()) {
v47E5Rz = tmp6(1115).t["2YaiQ1"];
2026-07-29 08:29:29 +00:00
}
const obj = { body: null, footer: null };
const intl = tmp6(1115).intl;
const obj2 = { role: extractEveryoneRoleResult, count: null };
2026-07-29 08:29:29 +00:00
const _Math4 = Math;
const result = Math.trunc(everyoneMemberCountResult / powResult) * powResult;
obj2.count = result.toLocaleString();
obj.body = intl.formatToPlainString(v47E5Rz, obj2);
const intl2 = tmp6(1115).intl;
obj.footer = intl2.string(util.t.mVyrtu);
2026-07-29 08:29:29 +00:00
return obj;
} else {
return false;
}
tmp9Result = tmp9(10397);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} else {
return false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
},
analyticsType: "@Everyone Warning",
animation: "channel_id"
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
{
check(arg0) {
let isMatch = TOKEN_REGEX.test(arg0);
if (isMatch) {
const obj = { body: null };
const intl = util.intl;
obj.body = intl.string(util.t.sTwS1a);
2026-07-29 08:29:29 +00:00
isMatch = obj;
}
return isMatch;
},
analyticsType: "API Token Warning"
}
];
let result = size.fileFinishedImporting("utils/ChatRestrictions.tsx");
2026-07-20 16:05:17 +00:00
export const RESTRICTIONS = items;