decord/source/utils/InviteErrorUtils.tsx

89 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11963
// Function ID: 11964
2026-07-20 16:05:17 +00:00
// Name: getDescriptiveInviteError
2026-08-05 07:35:12 +00:00
// Dependencies: [1874, 676, 3901, 1236, 1945, 2]
2026-07-20 16:05:17 +00:00
// Exports: getDescriptiveInviteError, getInviteError
2026-08-05 07:35:12 +00:00
// Module 11963 (getDescriptiveInviteError)
2026-07-29 08:29:29 +00:00
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
2026-07-23 10:11:24 +00:00
const 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);
const result = require("getPremiumPlanItem").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 };
const intl7 = require(1236) /* getSystemLocale */.intl;
obj = { quantity: null };
obj[0] = tmp14;
obj[0] = intl7.formatToPlainString(require(1236) /* getSystemLocale */.t["ttJ/hj"], obj);
const intl8 = require(1236) /* getSystemLocale */.intl;
obj[1] = intl8.string(require(1236) /* 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-05 07:35:12 +00:00
obj5 = importDefault(3901);
2026-07-29 08:29:29 +00:00
} else if (tmp.GUILD_AT_CAPACITY === code) {
const obj1 = { title: null, description: null };
const intl5 = require(1236) /* getSystemLocale */.intl;
obj1[0] = intl5.string(require(1236) /* getSystemLocale */.t.ZZlox4);
const intl6 = require(1236) /* getSystemLocale */.intl;
obj1[1] = intl6.string(require(1236) /* 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 };
const intl3 = require(1236) /* getSystemLocale */.intl;
obj2[0] = intl3.string(require(1236) /* getSystemLocale */.t.kJwpBW);
const intl4 = require(1236) /* getSystemLocale */.intl;
obj2[1] = intl4.string(require(1236) /* 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 };
const intl = require(1236) /* getSystemLocale */.intl;
obj[0] = intl.string(require(1236) /* getSystemLocale */.t["u/xsK9"]);
const intl2 = require(1236) /* getSystemLocale */.intl;
obj[1] = intl2.string(require(1236) /* 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) {
const intl6 = require(1236) /* getSystemLocale */.intl;
return intl6.string(require(1236) /* getSystemLocale */.t.iLyuDO);
} else if (tmp.GUILD_AT_CAPACITY === arg0) {
const intl5 = require(1236) /* getSystemLocale */.intl;
return intl5.string(require(1236) /* getSystemLocale */.t.M6unNJ);
} else if (tmp.INVALID_COUNTRY_CODE === arg0) {
const intl4 = require(1236) /* getSystemLocale */.intl;
return intl4.string(require(1236) /* getSystemLocale */.t.sRJGR1);
} else if (tmp.INVALID_CANNOT_FRIEND_SELF === arg0) {
const intl3 = require(1236) /* getSystemLocale */.intl;
return intl3.string(require(1236) /* getSystemLocale */.t["mY2R+F"]);
} else if (tmp.INVITES_DISABLED === arg0) {
const intl2 = require(1236) /* getSystemLocale */.intl;
const obj = { articleLink: null };
obj[0] = importDefault(1945).getArticleURL(constants2.INVITE_DISABLED);
return intl2.format(require(1236) /* getSystemLocale */.t.RXSeLl, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.string(require(1236) /* getSystemLocale */.t.dDZRdy);
2026-07-20 16:05:17 +00:00
}
};