decord/source/utils/InviteErrorUtils.tsx

88 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 12280
// Function ID: 12281
2026-07-20 16:05:17 +00:00
// Name: getDescriptiveInviteError
2026-08-25 06:04:03 +00:00
// Dependencies: [1922, 676, 4043, 1236, 1995, 2]
2026-07-20 16:05:17 +00:00
// Exports: getDescriptiveInviteError, getInviteError
2026-08-25 06:04:03 +00:00
// Module 12280 (getDescriptiveInviteError)
2026-08-24 06:08:38 +00:00
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import combinedDefault from "combined" /* 1995 */;
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4043 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "mergeGuildAvatar" /* 1922 */;
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ AbortCodes: c4, HelpdeskArticles: c5, MAX_USER_GUILDS: closure_6, MAX_USER_GUILDS_PREMIUM: error } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").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) {
2026-07-23 10:11:24 +00:00
currentUser = currentUser.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) {
2026-07-29 08:29:29 +00:00
let tmp14 = closure_6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { title: null, description: null };
2026-08-24 06:08:38 +00:00
const intl7 = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
obj = { quantity: null };
obj[0] = tmp14;
2026-08-24 06:08:38 +00:00
obj[0] = intl7.formatToPlainString(getSystemLocale.t["ttJ/hj"], obj);
const intl8 = getSystemLocale.intl;
obj[1] = intl8.string(getSystemLocale.t.iLyuDO);
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-29 08:29:29 +00:00
tmp14 = closure_7;
2026-08-24 06:08:38 +00:00
obj5 = getPremiumPlanItemDefault;
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_AT_CAPACITY === code) {
2026-08-24 06:08:38 +00:00
obj1 = { title: null, description: null };
const intl5 = getSystemLocale.intl;
obj1[0] = intl5.string(getSystemLocale.t.ZZlox4);
const intl6 = getSystemLocale.intl;
obj1[1] = intl6.string(getSystemLocale.t.ZUEGFn);
2026-07-20 16:05:17 +00:00
return obj1;
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_JOIN_INVITE_LIMITED_ACCESS === code) {
const obj2 = { title: null, description: null };
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
obj2[0] = intl3.string(getSystemLocale.t.kJwpBW);
const intl4 = getSystemLocale.intl;
obj2[1] = intl4.string(getSystemLocale.t.ZUEGFn);
2026-07-20 16:05:17 +00:00
return obj2;
2026-07-29 08:29:29 +00:00
} else if (tmp.USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED === code) {
obj = { title: null, description: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[0] = intl.string(getSystemLocale.t["u/xsK9"]);
const intl2 = getSystemLocale.intl;
obj[1] = intl2.string(getSystemLocale.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) {
2026-08-24 06:08:38 +00:00
const intl6 = getSystemLocale.intl;
return intl6.string(getSystemLocale.t.iLyuDO);
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_AT_CAPACITY === arg0) {
2026-08-24 06:08:38 +00:00
const intl5 = getSystemLocale.intl;
return intl5.string(getSystemLocale.t.M6unNJ);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVALID_COUNTRY_CODE === arg0) {
2026-08-24 06:08:38 +00:00
const intl4 = getSystemLocale.intl;
return intl4.string(getSystemLocale.t.sRJGR1);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVALID_CANNOT_FRIEND_SELF === arg0) {
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
return intl3.string(getSystemLocale.t["mY2R+F"]);
2026-07-29 08:29:29 +00:00
} else if (tmp.INVITES_DISABLED === arg0) {
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
const obj = { articleLink: null };
2026-08-24 06:08:38 +00:00
obj[0] = combinedDefault.getArticleURL(constants2.INVITE_DISABLED);
return intl2.format(getSystemLocale.t.RXSeLl, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
return intl.string(getSystemLocale.t.dDZRdy);
2026-07-20 16:05:17 +00:00
}
};