decord/alpha/source/modules/guild_verification/GuildVerificationManager.tsx

69 lines
2.3 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 18121
// Function ID: 18122
// Name: GuildVerificationManager
2026-10-13 12:43:34 +00:00
// Dependencies: [1085, 13516, 1403, 8511, 13517, 6808, 2]
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 18121 (GuildVerificationManager)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import FlagUtils from "FlagUtils" /* 1403 */;
2026-10-12 06:59:38 +00:00
import GuildInviteFlags from "GuildInviteFlags" /* 8511 */;
2026-10-13 12:43:34 +00:00
import HubUtilsDefault from "HubUtils" /* 13516 */;
import GuildVerificationUtils from "GuildVerificationUtils" /* 13517 */;
2026-10-12 06:59:38 +00:00
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6808 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function handleInviteData(invite) {
const guild = invite.invite.guild;
2026-07-29 08:29:29 +00:00
let num = invite.invite.flags;
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
if (null != guild) {
2026-07-29 08:29:29 +00:00
let hasItem;
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-07-29 08:29:29 +00:00
if (features != null) {
hasItem = features.includes(GuildFeatures.HUB);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (hasItem) {
2026-10-03 08:58:59 +00:00
const obj5 = HubUtilsDefault;
obj5.onOpenHubInvite(invite.invite);
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
let new_member = invite.invite.new_member;
if (new_member) {
2026-10-03 08:58:59 +00:00
const obj = FlagUtils;
let hasFlagResult = obj.hasFlag(num, GuildInviteFlags.GuildInviteFlags.IS_GUEST_INVITE);
2026-07-20 16:05:17 +00:00
if (!hasFlagResult) {
2026-10-03 08:58:59 +00:00
const tmp3Result = FlagUtils;
2026-10-12 06:59:38 +00:00
hasFlagResult = tmp3Result.hasFlag(num, tmp3(8511).GuildInviteFlags.IS_APPLICATION_BYPASS);
2026-07-20 16:05:17 +00:00
}
new_member = !hasFlagResult;
}
if (new_member) {
new_member = null != guild;
}
if (new_member) {
2026-10-03 08:58:59 +00:00
const obj3 = GuildVerificationUtils;
new_member = obj3.inviteGuildHasPendingMemberDisabledVerification(guild);
2026-07-20 16:05:17 +00:00
}
if (new_member) {
2026-10-03 08:58:59 +00:00
const obj4 = GuildVerificationUtils;
const result = obj4.openVerificationModalOrTransitionToApplication(guild.id);
2026-07-20 16:05:17 +00:00
}
}
const GuildFeatures = Constants.GuildFeatures;
2026-10-03 08:58:59 +00:00
class GuildVerificationManager extends AutomaticLifecycleManager {
constructor() {
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
const obj = { INVITE_ACCEPT_SUCCESS: handleInviteData };
applyArgumentsResult.actions = obj;
return applyArgumentsResult;
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
const guildVerificationManager = new GuildVerificationManager();
let result = size.fileFinishedImporting("modules/guild_verification/GuildVerificationManager.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export default guildVerificationManager;