decord/source/modules/guild_member_verification/MemberVerificationUtils.tsx
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

72 lines
2.8 KiB
TypeScript

// Module ID: 5142
// Function ID: 5143
// Name: MemberVerificationUtils
// Dependencies: [5143, 1074, 4464, 1370, 2]
// Exports: guildHasVerificationGate, isAutomaticApprovalFormField, isManualApprovalFormField, isValidFormResponse, removeInternalFields
// Module 5142 (MemberVerificationUtils)
import Constants from "Constants" /* 1074 */;
import MemberVerificationTypes from "MemberVerificationTypes" /* 4464 */;
import MemberVerificationConstants from "MemberVerificationConstants" /* 5143 */;
import size from "module_2" /* 2 */;
({ AUTOMATIC_APPROVAL_FORM_FIELDS: c2, MANUAL_APPROVAL_FORM_FIELDS: c3 } = MemberVerificationConstants);
const GuildFeatures = Constants.GuildFeatures;
const result = size.fileFinishedImporting("modules/guild_member_verification/MemberVerificationUtils.tsx");
export const isValidFormResponse = function isValidFormResponse(required) {
({ response, field_type } = required);
if (required.required) {
if (null == response) {
return false;
} else {
if (MemberVerificationTypes.VerificationFormFieldTypes.TERMS !== field_type) {
if (tmp4(4464).VerificationFormFieldTypes.VERIFICATION !== field_type) {
if (tmp4(4464).VerificationFormFieldTypes.TEXT_INPUT !== field_type) {
if (tmp4(4464).VerificationFormFieldTypes.PARAGRAPH !== field_type) {
if (tmp4(4464).VerificationFormFieldTypes.MULTIPLE_CHOICE === field_type) {
return typeof response === "number";
} else {
return tmp4(1370).assertNever(field_type);
}
}
}
let tmp2 = typeof response === "string";
if (typeof response === "string") {
tmp2 = "" !== response.trim();
}
return tmp2;
}
}
const _Boolean = Boolean;
return Boolean(response);
}
} else {
return true;
}
};
export const removeInternalFields = function removeInternalFields(arr) {
return arr.filter((field_type) => field_type.field_type !== MemberVerificationTypes.VerificationFormFieldTypes.VERIFICATION);
};
export const isAutomaticApprovalFormField = function isAutomaticApprovalFormField(field_type) {
field_type = undefined;
if (field_type != null) {
field_type = field_type.field_type;
}
return set.has(field_type);
};
export const isManualApprovalFormField = function isManualApprovalFormField(field_type) {
field_type = undefined;
if (field_type != null) {
field_type = field_type.field_type;
}
return set2.has(field_type);
};
export const guildHasVerificationGate = function guildHasVerificationGate(guild) {
let hasItem = null != guild;
if (hasItem) {
const features = guild.features;
hasItem = features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED);
}
return hasItem;
};