decord/source/utils/InviteErrorUtils.tsx

87 lines
3.1 KiB
TypeScript
Raw Normal View History

// Module ID: 12867
// Function ID: 12868
// Name: InviteErrorUtils
// Dependencies: [1372, 1074, 4295, 1115, 2025, 2]
2026-07-20 16:05:17 +00:00
// Exports: getDescriptiveInviteError, getInviteError
// Module 12867 (InviteErrorUtils)
import util from "util" /* 1115 */;
import HelpdeskUtilsDefault from "HelpdeskUtils" /* 2025 */;
import PremiumUtilsDefault from "PremiumUtils" /* 4295 */;
import UserStore from "UserStore" /* 1372 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Constants = fn(1074);
({ AbortCodes: closure_4, HelpdeskArticles: hasOwnProperty, MAX_USER_GUILDS: metroRequire, MAX_USER_GUILDS_PREMIUM: closure_7 } = Constants);
const size = fn(2);
const result = size.fileFinishedImporting("utils/InviteErrorUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getDescriptiveInviteError = function getDescriptiveInviteError(code) {
if (constants.TOO_MANY_USER_GUILDS === code) {
const currentUser = UserStore.getCurrentUser();
2026-07-20 16:05:17 +00:00
if (!obj5.canUseIncreasedGuildCap(currentUser)) {
let isStaffResult;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
isStaffResult = currentUser.isStaff();
}
if (!isStaffResult) {
let tmp14 = timestampProducer;
2026-07-20 16:05:17 +00:00
}
const obj2 = { title: null, description: null };
const intl7 = util.intl;
const obj3 = { quantity: tmp14 };
obj2.title = intl7.formatToPlainString(util.t["ttJ/hj"], obj3);
const intl8 = util.intl;
obj2.description = intl8.string(util.t.iLyuDO);
return obj2;
2026-07-20 16:05:17 +00:00
}
tmp14 = React5;
obj5 = PremiumUtilsDefault;
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_AT_CAPACITY === code) {
const obj4 = { title: null, description: null };
const intl5 = util.intl;
obj4.title = intl5.string(util.t.ZZlox4);
const intl6 = util.intl;
obj4.description = intl6.string(util.t.ZUEGFn);
return obj4;
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_JOIN_INVITE_LIMITED_ACCESS === code) {
const obj6 = { title: null, description: null };
const intl3 = util.intl;
obj6.title = intl3.string(util.t.kJwpBW);
const intl4 = util.intl;
obj6.description = intl4.string(util.t.ZUEGFn);
return obj6;
2026-07-29 08:29:29 +00:00
} else if (tmp.USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED === code) {
const obj = { title: null, description: null };
const intl = util.intl;
obj.title = intl.string(util.t["u/xsK9"]);
const intl2 = util.intl;
obj.description = intl2.string(util.t.SxY4IW);
2026-07-20 16:05:17 +00:00
return obj;
} else {
return null;
}
};
2026-07-29 08:29:29 +00:00
export const getInviteError = function getInviteError(arg0) {
if (constants.TOO_MANY_USER_GUILDS === arg0) {
const intl6 = util.intl;
return intl6.string(util.t.iLyuDO);
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_AT_CAPACITY === arg0) {
const intl5 = util.intl;
return intl5.string(util.t.M6unNJ);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVALID_COUNTRY_CODE === arg0) {
const intl4 = util.intl;
return intl4.string(util.t.sRJGR1);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVALID_CANNOT_FRIEND_SELF === arg0) {
const intl3 = util.intl;
return intl3.string(util.t["mY2R+F"]);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVITES_DISABLED === arg0) {
const intl2 = util.intl;
const obj = { articleLink: HelpdeskUtilsDefault.getArticleURL(constants2.INVITE_DISABLED) };
return intl2.format(util.t.RXSeLl, obj);
2026-07-20 16:05:17 +00:00
} else {
const intl = util.intl;
return intl.string(util.t.dDZRdy);
2026-07-20 16:05:17 +00:00
}
};