Files
discord-decomp/utils/ChatRestrictions.tsx
T
2026-11-01 12:12:55 +02:00

45 lines
1.2 KiB
TypeScript

// Metro module 9573 (f9574).
import { TOKEN_REGEX } from "../Constants";
import MentionGuardUtils from "./MentionGuardUtils";
import { t, intl } from "../intl/index.native";
const r17 = [{
check: (a0, a1, a2) => {
if (a2) {
if (a1.getGuildId() == null) {
return false;
}
const role = MentionGuardUtils.extractEveryoneRole(a0, a1);
if (role == null) {
return false;
}
if (MentionGuardUtils.shouldShowEveryoneGuard(role, a1)) {
const r10 = MentionGuardUtils.everyoneMemberCount(role, a1);
const r34 = Math.pow(10, Math.floor(Math.log10(r10)));
let r39 = t["47E5Rz"];
if (a1.isForumPost()) {
r39 = t.sYW2cy;
} else if (a1.isThread()) {
r39 = t["2YaiQ1"];
}
return {
body: intl.formatToPlainString(r39, {
role,
count: (Math.trunc(r10 / r34) * r34).toLocaleString()
}),
footer: intl.string(t.mVyrtu)
};
}
return false;
}
return false;
},
analyticsType: "@Everyone Warning",
animation: void 0
}, {
check: (a0) => !!TOKEN_REGEX.test(a0) && {
body: intl.string(t.sTwS1a)
},
analyticsType: "API Token Warning"
}];
export { r17 as RESTRICTIONS };