Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
675 lines
21 KiB
TypeScript
675 lines
21 KiB
TypeScript
// Module ID: 1386
|
|
// Function ID: 1387
|
|
// Name: UserRecord
|
|
// Dependencies: [1387, 1074, 1374, 1388, 1389, 1393, 1394, 1378, 1395, 1396, 1086, 11, 1397, 1385, 1970, 1380, 1966, 1971, 2]
|
|
|
|
// Module 1386 (UserRecord)
|
|
import BigFlagUtilsAll from "BigFlagUtils" /* 1086 */;
|
|
import FlagUtils from "FlagUtils" /* 1385 */;
|
|
import AvatarUtils from "AvatarUtils" /* 1397 */;
|
|
import AvatarDecorationUtils from "AvatarDecorationUtils" /* 1966 */;
|
|
import PremiumTypeUtils from "PremiumTypeUtils" /* 1970 */;
|
|
import Record from "Record" /* 1387 */;
|
|
|
|
const AvatarUtilsDefault = AvatarUtils;
|
|
|
|
require = fn;
|
|
const Constants = fn(1074);
|
|
({ LOCAL_BOT_ID: closure_4, NON_USER_BOT_DISCRIMINATOR: hasOwnProperty, PREMIUM_TYPE_NONE: metroRequire, UserFlags: closure_7 } = Constants);
|
|
const PremiumConstants = fn(1374);
|
|
({ SKU_ID_PURCHASED_FLAGS: closure_8, PremiumTypes: closure_9, PurchasedFlags: c10 } = PremiumConstants);
|
|
class UserRecord extends tmp2 {
|
|
constructor(arg0) {
|
|
closure_0 = undefined;
|
|
tmp6 = new UserRecord(tmp5, tmp4, tmp3, tmp2, new.target, tmp, global, new.target, undefined);
|
|
closure_0 = tmp6;
|
|
tmp6.hasFlag = function hasFlag() {
|
|
return false;
|
|
};
|
|
tmp6.isStaff = function isStaff() {
|
|
return false;
|
|
};
|
|
tmp6.isStaffPersonal = function isStaffPersonal() {
|
|
return false;
|
|
};
|
|
tmp6.hasAnyStaffLevel = function hasAnyStaffLevel() {
|
|
return false;
|
|
};
|
|
premiumType = global.premium_type;
|
|
if (premiumType == null) {
|
|
premiumType = global.premiumType;
|
|
}
|
|
({ id: tmp6.id, username } = global);
|
|
if (username == null) {
|
|
username = "";
|
|
}
|
|
tmp6.username = username;
|
|
discriminator = global.discriminator;
|
|
if (discriminator == null) {
|
|
discriminator = closure_5;
|
|
}
|
|
tmp6.discriminator = discriminator;
|
|
avatar = global.avatar;
|
|
if (avatar == null) {
|
|
avatar = null;
|
|
}
|
|
tmp6.avatar = avatar;
|
|
avatarDecorationData = global.avatar_decoration_data;
|
|
if (avatarDecorationData == null) {
|
|
avatarDecorationData = global.avatarDecorationData;
|
|
}
|
|
tmp6.avatarDecoration = avatarDecorationData;
|
|
email = global.email;
|
|
if (email == null) {
|
|
email = null;
|
|
}
|
|
tmp6.email = email;
|
|
flag = global.verified;
|
|
if (flag == null) {
|
|
flag = false;
|
|
}
|
|
tmp6.verified = flag;
|
|
flag2 = global.bot;
|
|
if (flag2 == null) {
|
|
flag2 = false;
|
|
}
|
|
tmp6.bot = flag2;
|
|
flag3 = global.system;
|
|
if (flag3 == null) {
|
|
flag3 = false;
|
|
}
|
|
tmp6.system = flag3;
|
|
flag4 = global.mfa_enabled;
|
|
if (flag4 == null) {
|
|
flag4 = global.mfaEnabled;
|
|
}
|
|
if (flag4 == null) {
|
|
flag4 = false;
|
|
}
|
|
tmp6.mfaEnabled = flag4;
|
|
flag5 = global.mobile;
|
|
if (flag5 == null) {
|
|
flag5 = false;
|
|
}
|
|
tmp6.mobile = flag5;
|
|
flag6 = global.desktop;
|
|
if (flag6 == null) {
|
|
flag6 = false;
|
|
}
|
|
tmp6.desktop = flag6;
|
|
tmp9 = null;
|
|
if (premiumType !== PREMIUM_TYPE_NONE) {
|
|
tmp9 = premiumType;
|
|
}
|
|
tmp6.premiumType = tmp9;
|
|
num = global.flags;
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
tmp6.flags = num;
|
|
num2 = global.public_flags;
|
|
if (num2 == null) {
|
|
num2 = global.publicFlags;
|
|
}
|
|
if (num2 == null) {
|
|
num2 = 0;
|
|
}
|
|
tmp6.publicFlags = num2;
|
|
num3 = global.purchased_flags;
|
|
if (num3 == null) {
|
|
num3 = global.purchasedFlags;
|
|
}
|
|
if (num3 == null) {
|
|
num3 = 0;
|
|
}
|
|
tmp6.purchasedFlags = num3;
|
|
num4 = global.premium_usage_flags;
|
|
if (num4 == null) {
|
|
num4 = global.premiumUsageFlags;
|
|
}
|
|
if (num4 == null) {
|
|
num4 = 0;
|
|
}
|
|
tmp6.premiumUsageFlags = num4;
|
|
phone = global.phone;
|
|
if (phone == null) {
|
|
phone = null;
|
|
}
|
|
tmp6.phone = phone;
|
|
nsfwAllowed = global.nsfw_allowed;
|
|
if (nsfwAllowed == null) {
|
|
nsfwAllowed = global.nsfwAllowed;
|
|
}
|
|
tmp6.nsfwAllowed = nsfwAllowed;
|
|
ageVerificationStatus = global.age_verification_status;
|
|
if (ageVerificationStatus == null) {
|
|
ageVerificationStatus = global.ageVerificationStatus;
|
|
}
|
|
tmp6.ageVerificationStatus = ageVerificationStatus;
|
|
guildMemberAvatars = global.guildMemberAvatars;
|
|
if (guildMemberAvatars == null) {
|
|
guildMemberAvatars = {};
|
|
}
|
|
tmp6.guildMemberAvatars = guildMemberAvatars;
|
|
flag7 = global.has_bounced_email;
|
|
if (flag7 == null) {
|
|
flag7 = global.hasBouncedEmail;
|
|
}
|
|
if (flag7 == null) {
|
|
flag7 = false;
|
|
}
|
|
tmp6.hasBouncedEmail = flag7;
|
|
prop = global.personal_connection_id;
|
|
if (prop == null) {
|
|
prop = global.personalConnectionId;
|
|
}
|
|
if (prop == null) {
|
|
prop = null;
|
|
}
|
|
tmp6.personalConnectionId = prop;
|
|
globalName = global.global_name;
|
|
if (globalName == null) {
|
|
globalName = global.globalName;
|
|
}
|
|
tmp6.globalName = globalName;
|
|
tmp6.banner = global.banner;
|
|
tmp12 = closure_0;
|
|
tmp13 = closure_3;
|
|
obj2 = closure_0(closure_3[3]);
|
|
primary_guild = global.primary_guild;
|
|
if (primary_guild == null) {
|
|
primary_guild = global.primaryGuild;
|
|
}
|
|
if (primary_guild == null) {
|
|
primary_guild = null;
|
|
}
|
|
tmp6.primaryGuild = obj2.ensureUserPrimaryGuild(primary_guild);
|
|
({ collectibles: tmp6.collectibles, displayNameStyles } = global);
|
|
if (displayNameStyles == null) {
|
|
tmp12Result = tmp12(tmp13[4]);
|
|
displayNameStyles = tmp12Result.parseServerDisplayNameStyles(global.display_name_styles);
|
|
}
|
|
tmp6.displayNameStyles = displayNameStyles;
|
|
vadColors = global.vadColors;
|
|
if (vadColors == null) {
|
|
vadColors = global.vad_colors;
|
|
}
|
|
if (vadColors == null) {
|
|
vadColors = null;
|
|
}
|
|
tmp6.vadColors = vadColors;
|
|
typingIndicatorStyle = global.typingIndicatorStyle;
|
|
if (typingIndicatorStyle == null) {
|
|
tmp12Result1 = tmp12(tmp13[5]);
|
|
typingIndicatorStyle = tmp12Result1.parseServerTypingIndicatorStyle(global.typing_indicator_style);
|
|
}
|
|
tmp6.typingIndicatorStyle = typingIndicatorStyle;
|
|
premiumState = global.premiumState;
|
|
if (premiumState == null) {
|
|
tmp12Result2 = tmp12(tmp13[6]);
|
|
premiumState = tmp12Result2.parseServerPremiumState(global.premium_state);
|
|
}
|
|
tmp6.premiumState = premiumState;
|
|
perks = global.perks;
|
|
activePerksBitmask = undefined;
|
|
if (perks != null) {
|
|
activePerksBitmask = perks.activePerksBitmask;
|
|
}
|
|
if (null != activePerksBitmask) {
|
|
perks2 = global.perks;
|
|
} else {
|
|
tmp12Result3 = tmp12(tmp13[7]);
|
|
perks2 = tmp12Result3.parseServerPerks(global.perks);
|
|
}
|
|
tmp6.perks = perks2;
|
|
tmp12Result4 = tmp12(tmp13[8]);
|
|
restrictedSchedule = global.restricted_schedule;
|
|
if (restrictedSchedule == null) {
|
|
restrictedSchedule = global.restrictedSchedule;
|
|
}
|
|
tmp6.restrictedSchedule = tmp12Result4.ensureRestrictedScheduleRecord(restrictedSchedule);
|
|
appTransactionIds = global.appTransactionIds;
|
|
if (appTransactionIds == null) {
|
|
appTransactionIds = global.app_transaction_ids;
|
|
}
|
|
if (appTransactionIds == null) {
|
|
appTransactionIds = null;
|
|
}
|
|
tmp6.appTransactionIds = appTransactionIds;
|
|
tmp12Result5 = tmp12(tmp13[9]);
|
|
storeCountry = global.store_country;
|
|
if (storeCountry == null) {
|
|
storeCountry = global.storeCountry;
|
|
}
|
|
tmp6.storeCountry = tmp12Result5.parseStoreCountry(storeCountry);
|
|
obj1 = {
|
|
hasFlag: {
|
|
writable: false,
|
|
configurable: false,
|
|
enumerable: false,
|
|
value(arg0) {
|
|
if (arg0 <= 1073741824) {
|
|
return ((closure_0.flags | closure_0.publicFlags) & arg0) === arg0;
|
|
} else {
|
|
const deserializer = BigFlagUtilsAll;
|
|
const deserializer2 = BigFlagUtilsAll;
|
|
const deserializeResult = deserializer.deserialize(closure_0.flags);
|
|
const deserializer3 = BigFlagUtilsAll;
|
|
const deserializeResult1 = deserializer2.deserialize(closure_0.publicFlags);
|
|
const deserializeResult2 = deserializer3.deserialize(arg0);
|
|
const obj = BigFlagUtilsAll;
|
|
return obj.has(BigFlagUtilsAll.combine(deserializeResult, deserializeResult1), deserializeResult2);
|
|
}
|
|
}
|
|
},
|
|
isStaff: {
|
|
writable: false,
|
|
configurable: false,
|
|
enumerable: false,
|
|
value() {
|
|
return closure_0.hasFlag(constants.STAFF);
|
|
}
|
|
},
|
|
isStaffPersonal: {
|
|
writable: false,
|
|
configurable: false,
|
|
enumerable: false,
|
|
value() {
|
|
const hasFlagResult = closure_0.hasFlag(constants.STAFF);
|
|
let tmp3 = !hasFlagResult;
|
|
if (!hasFlagResult) {
|
|
tmp3 = null != closure_0.personalConnectionId;
|
|
}
|
|
return tmp3;
|
|
}
|
|
},
|
|
hasAnyStaffLevel: {
|
|
writable: false,
|
|
configurable: false,
|
|
enumerable: false,
|
|
value() {
|
|
let hasFlagResult = closure_0.hasFlag(constants.STAFF);
|
|
if (!hasFlagResult) {
|
|
hasFlagResult = obj.hasFlag(tmp.COLLABORATOR);
|
|
}
|
|
if (!hasFlagResult) {
|
|
hasFlagResult = obj.hasFlag(tmp.RESTRICTED_COLLABORATOR);
|
|
}
|
|
return hasFlagResult;
|
|
}
|
|
}
|
|
};
|
|
definePropertiesResult = Object.defineProperties(tmp6, obj1);
|
|
globalName1 = tmp6.globalName;
|
|
length = undefined;
|
|
if (globalName1 != null) {
|
|
length = globalName1.length;
|
|
}
|
|
if (0 === length) {
|
|
tmp6.globalName = null;
|
|
}
|
|
return tmp6;
|
|
}
|
|
}
|
|
const prototype = UserRecord.prototype;
|
|
Object.defineProperty(prototype, "createdAt", {
|
|
get: function createdAt() {
|
|
const obj = require("SnowflakeUtils");
|
|
return new Date(require("SnowflakeUtils").extractTimestamp(this.id));
|
|
},
|
|
set: undefined
|
|
});
|
|
prototype["hasVerifiedEmailOrPhone"] = function hasVerifiedEmailOrPhone() {
|
|
let tmp = true === this.verified;
|
|
if (!tmp) {
|
|
tmp = null != this.phone;
|
|
}
|
|
return tmp;
|
|
};
|
|
prototype["getAvatarURL"] = function getAvatarURL(guildId, size, flag, SUPPORTS_WEBP) {
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
if (SUPPORTS_WEBP === undefined) {
|
|
SUPPORTS_WEBP = AvatarUtils.SUPPORTS_WEBP;
|
|
}
|
|
const self = this;
|
|
let tmp3;
|
|
if (null != guildId) {
|
|
tmp3 = self.guildMemberAvatars[guildId];
|
|
}
|
|
if (null != tmp3) {
|
|
if (null != guildId) {
|
|
const obj3 = { guildId, avatar: tmp3, userId: self.id, canAnimate: flag, size, canWebP: SUPPORTS_WEBP };
|
|
let guildMemberAvatarURLSimple = AvatarUtilsDefault.getGuildMemberAvatarURLSimple(obj3);
|
|
}
|
|
return guildMemberAvatarURLSimple;
|
|
}
|
|
guildMemberAvatarURLSimple = AvatarUtilsDefault.getUserAvatarURL(self, flag, size, null, SUPPORTS_WEBP);
|
|
};
|
|
prototype["addGuildAvatarHash"] = function addGuildAvatarHash(guildId, avatar) {
|
|
const self = this;
|
|
if (this.guildMemberAvatars[guildId] === avatar) {
|
|
return self;
|
|
} else {
|
|
const obj = {};
|
|
const merged = Object.assign(self.guildMemberAvatars);
|
|
obj[guildId] = avatar;
|
|
const obj2 = { guildMemberAvatars: obj };
|
|
return self.merge(obj2);
|
|
}
|
|
};
|
|
prototype["removeGuildAvatarHash"] = function removeGuildAvatarHash(guildId) {
|
|
const self = this;
|
|
if (undefined === this.guildMemberAvatars[guildId]) {
|
|
return self;
|
|
} else {
|
|
const obj = {};
|
|
const merged = Object.assign(self.guildMemberAvatars);
|
|
obj[guildId] = undefined;
|
|
const obj2 = { guildMemberAvatars: obj };
|
|
return self.merge(obj2);
|
|
}
|
|
};
|
|
prototype["getAvatarSource"] = function getAvatarSource(guildId, flag, size) {
|
|
const self = this;
|
|
importDefault = guildId;
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
let avatar;
|
|
if (null != guildId) {
|
|
avatar = tmp;
|
|
if (null != this.guildMemberAvatars[guildId]) {
|
|
return require("AvatarUtils").getAnimatableSourceWithFallback(flag, (canAnimate) => {
|
|
const obj = AvatarUtilsDefault;
|
|
return obj.makeSource(AvatarUtilsDefault.getGuildMemberAvatarURLSimple({ guildId, avatar, userId: self.id, canAnimate, size }));
|
|
});
|
|
}
|
|
}
|
|
return require("AvatarUtils").getAnimatableSourceWithFallback(flag, (flag) => AvatarUtilsDefault.getUserAvatarSource(self, flag, closure_2));
|
|
};
|
|
prototype["isClaimed"] = function isClaimed() {
|
|
return null != this.email || null != this.phone;
|
|
};
|
|
prototype["isPhoneVerified"] = function isPhoneVerified() {
|
|
return null != this.phone;
|
|
};
|
|
prototype["toString"] = function toString() {
|
|
let str = "???";
|
|
if ("" !== this.username) {
|
|
str = this.username;
|
|
}
|
|
return str;
|
|
};
|
|
Object.defineProperty(prototype, "tag", {
|
|
get: function tag() {
|
|
const combined = "" + this.discriminator;
|
|
return "" + this.username + "#" + combined.padStart(4, "0");
|
|
},
|
|
set: undefined
|
|
});
|
|
prototype["hasPurchasedFlag"] = function hasPurchasedFlag(PREMIUM_TIER_0) {
|
|
return FlagUtils.hasFlag(this.purchasedFlags, PREMIUM_TIER_0);
|
|
};
|
|
prototype["hasPremiumUsageFlag"] = function hasPremiumUsageFlag(arg0) {
|
|
return FlagUtils.hasFlag(this.premiumUsageFlags, arg0);
|
|
};
|
|
prototype["hasHadSKU"] = function hasHadSKU(arg0) {
|
|
let hasPurchasedFlagResult = null != tmp;
|
|
if (hasPurchasedFlagResult) {
|
|
const self = this;
|
|
hasPurchasedFlagResult = this.hasPurchasedFlag(tmp);
|
|
}
|
|
return hasPurchasedFlagResult;
|
|
};
|
|
prototype["hasHadPremium"] = function hasHadPremium(arg0) {
|
|
let tmp = arg0;
|
|
if (arg0 === undefined) {
|
|
tmp = null;
|
|
}
|
|
const hasPurchasedFlagResult = this.hasPurchasedFlag(closure_1_10.PREMIUM_TIER_0);
|
|
const hasPurchasedFlagResult1 = this.hasPurchasedFlag(closure_1_10.PREMIUM_TIER_1);
|
|
const hasPurchasedFlagResult2 = this.hasPurchasedFlag(closure_1_10.PREMIUM_TIER_2);
|
|
if (React7.TIER_0 === tmp) {
|
|
return hasPurchasedFlagResult;
|
|
} else if (tmp5.TIER_1 === tmp) {
|
|
return hasPurchasedFlagResult1;
|
|
} else if (tmp5.TIER_2 === tmp) {
|
|
return hasPurchasedFlagResult2;
|
|
} else {
|
|
let tmp6 = hasPurchasedFlagResult;
|
|
if (!hasPurchasedFlagResult) {
|
|
tmp6 = hasPurchasedFlagResult1;
|
|
}
|
|
if (!tmp6) {
|
|
tmp6 = hasPurchasedFlagResult2;
|
|
}
|
|
return tmp6;
|
|
}
|
|
};
|
|
prototype["hadPremiumSubscription"] = function hadPremiumSubscription() {
|
|
let tmp = arg0;
|
|
if (arg0 === undefined) {
|
|
tmp = null;
|
|
}
|
|
const self = this;
|
|
const isPremiumResult = PremiumTypeUtils.isPremium(this);
|
|
let hasHadPremiumResult = !isPremiumResult;
|
|
if (!isPremiumResult) {
|
|
hasHadPremiumResult = self.hasHadPremium(tmp);
|
|
}
|
|
return hasHadPremiumResult;
|
|
};
|
|
prototype["hasFreePremium"] = function hasFreePremium() {
|
|
const self = this;
|
|
let isStaffResult = this.isStaff();
|
|
if (!isStaffResult) {
|
|
isStaffResult = self.hasFlag(constants.PARTNER);
|
|
}
|
|
if (!isStaffResult) {
|
|
isStaffResult = self.isStaffPersonal();
|
|
}
|
|
return isStaffResult;
|
|
};
|
|
prototype["isOnReverseTrial"] = function isOnReverseTrial() {
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this);
|
|
if (isPremiumResult) {
|
|
const premiumState = this.premiumState;
|
|
let premiumSource;
|
|
if (premiumState != null) {
|
|
premiumSource = premiumState.premiumSource;
|
|
}
|
|
isPremiumResult = premiumSource === require("user").PremiumSource.REVERSE_TRIAL;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["isPremiumWithPremiumGroup"] = function isPremiumWithPremiumGroup() {
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this, React7.TIER_2);
|
|
if (isPremiumResult) {
|
|
const premiumState = this.premiumState;
|
|
let premiumSource;
|
|
if (premiumState != null) {
|
|
premiumSource = premiumState.premiumSource;
|
|
}
|
|
isPremiumResult = premiumSource === require("user").PremiumSource.SUBSCRIPTION_GROUP;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["hasPaidTier2Subscription"] = function hasPaidTier2Subscription() {
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this, React7.TIER_2);
|
|
if (isPremiumResult) {
|
|
const premiumState = this.premiumState;
|
|
let prop;
|
|
if (premiumState != null) {
|
|
prop = premiumState.premiumSubscriptionType;
|
|
}
|
|
isPremiumResult = prop === require("user").PremiumSubscriptionType.TIER_2;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["isPremiumWithFractionalPremiumOnly"] = function isPremiumWithFractionalPremiumOnly() {
|
|
const self = this;
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this, React7.TIER_2);
|
|
if (isPremiumResult) {
|
|
const premiumState = self.premiumState;
|
|
let prop;
|
|
if (premiumState != null) {
|
|
prop = premiumState.premiumSubscriptionType;
|
|
}
|
|
let tmp6 = prop === tmp(1380).PremiumSubscriptionType.NONE_UNSPECIFIED;
|
|
if (!tmp6) {
|
|
const premiumState2 = self.premiumState;
|
|
let prop1;
|
|
if (premiumState2 != null) {
|
|
prop1 = premiumState2.premiumSubscriptionType;
|
|
}
|
|
tmp6 = prop1 === tmp(1380).PremiumSubscriptionType.BOOST_ONLY;
|
|
}
|
|
isPremiumResult = tmp6;
|
|
}
|
|
if (isPremiumResult) {
|
|
const premiumState3 = self.premiumState;
|
|
let premiumSource;
|
|
if (premiumState3 != null) {
|
|
premiumSource = premiumState3.premiumSource;
|
|
}
|
|
isPremiumResult = premiumSource === tmp(1380).PremiumSource.FRACTIONAL_NITRO;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["isFractionalPremiumWithNoStandardSub"] = function isFractionalPremiumWithNoStandardSub() {
|
|
const self = this;
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this, React7.TIER_2);
|
|
if (isPremiumResult) {
|
|
const premiumState = self.premiumState;
|
|
let premiumSource;
|
|
if (premiumState != null) {
|
|
premiumSource = premiumState.premiumSource;
|
|
}
|
|
isPremiumResult = premiumSource === tmp(1380).PremiumSource.FRACTIONAL_NITRO;
|
|
}
|
|
if (isPremiumResult) {
|
|
isPremiumResult = self.premiumState.premiumSubscriptionType !== tmp(1380).PremiumSubscriptionType.TIER_2;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["isFractionalPremium"] = function isFractionalPremium() {
|
|
let isPremiumResult = PremiumTypeUtils.isPremium(this, React7.TIER_2);
|
|
if (isPremiumResult) {
|
|
const premiumState = this.premiumState;
|
|
let premiumSource;
|
|
if (premiumState != null) {
|
|
premiumSource = premiumState.premiumSource;
|
|
}
|
|
isPremiumResult = premiumSource === require("user").PremiumSource.FRACTIONAL_NITRO;
|
|
}
|
|
return isPremiumResult;
|
|
};
|
|
prototype["hasUrgentMessages"] = function hasUrgentMessages() {
|
|
return this.hasFlag(constants.HAS_UNREAD_URGENT_MESSAGES);
|
|
};
|
|
prototype["isNonUserBot"] = function isNonUserBot() {
|
|
const self = this;
|
|
let isSystemUserResult = this.isSystemUser();
|
|
if (!isSystemUserResult) {
|
|
let bot = self.bot;
|
|
if (bot) {
|
|
bot = self.discriminator === hasOwnProperty;
|
|
}
|
|
isSystemUserResult = bot;
|
|
}
|
|
return isSystemUserResult;
|
|
};
|
|
prototype["isLocalBot"] = function isLocalBot() {
|
|
let bot = this.bot;
|
|
if (bot) {
|
|
bot = this.id === React4;
|
|
}
|
|
return bot;
|
|
};
|
|
prototype["isVerifiedBot"] = function isVerifiedBot() {
|
|
const self = this;
|
|
let hasFlagResult = this.isSystemUser() || self.isLocalBot();
|
|
if (!hasFlagResult) {
|
|
hasFlagResult = self.hasFlag(constants.VERIFIED_BOT);
|
|
}
|
|
return hasFlagResult;
|
|
};
|
|
prototype["isSystemUser"] = function isSystemUser() {
|
|
return true === this.system;
|
|
};
|
|
prototype["hasAvatarForGuild"] = function hasAvatarForGuild(id) {
|
|
let tmp = null != id;
|
|
if (tmp) {
|
|
const self = this;
|
|
tmp = null != this.guildMemberAvatars[id];
|
|
}
|
|
return tmp;
|
|
};
|
|
prototype["hasUniqueUsername"] = function hasUniqueUsername() {
|
|
return "0" === this.discriminator;
|
|
};
|
|
prototype["isPremiumGroupMember"] = function isPremiumGroupMember() {
|
|
let result = this.isPremiumWithPremiumGroup();
|
|
if (result) {
|
|
result = this.premiumGroupRole === require("user").PremiumSubscriptionGroupRole.MEMBER;
|
|
}
|
|
return result;
|
|
};
|
|
prototype["isPremiumGroupPrimary"] = function isPremiumGroupPrimary() {
|
|
let result = this.isPremiumWithPremiumGroup();
|
|
if (result) {
|
|
result = this.premiumGroupRole === require("user").PremiumSubscriptionGroupRole.PRIMARY;
|
|
}
|
|
return result;
|
|
};
|
|
Object.defineProperty(prototype, "isProvisional", {
|
|
get: function isProvisional() {
|
|
return this.hasFlag(constants.PROVISIONAL_ACCOUNT);
|
|
},
|
|
set: undefined
|
|
});
|
|
Object.defineProperty(prototype, "avatarDecoration", {
|
|
get: function avatarDecoration() {
|
|
return this.avatarDecorationData;
|
|
},
|
|
set: undefined
|
|
});
|
|
Object.defineProperty(prototype, "avatarDecoration", {
|
|
get: undefined,
|
|
set: function avatarDecoration(avatar_decoration_data) {
|
|
this.avatarDecorationData = AvatarDecorationUtils.parseAvatarDecorationData(avatar_decoration_data);
|
|
}
|
|
});
|
|
Object.defineProperty(prototype, "nameplate", {
|
|
get: function nameplate() {
|
|
const collectibles = this.collectibles;
|
|
let nameplate;
|
|
if (collectibles != null) {
|
|
nameplate = collectibles.nameplate;
|
|
}
|
|
return require("utils").getNameplateData(nameplate);
|
|
},
|
|
set: undefined
|
|
});
|
|
Object.defineProperty(prototype, "premiumGroupRole", {
|
|
get: function premiumGroupRole() {
|
|
const premiumState = this.premiumState;
|
|
let prop;
|
|
if (premiumState != null) {
|
|
prop = premiumState.premiumSubscriptionGroupRole;
|
|
}
|
|
if (prop == null) {
|
|
prop = require("user").PremiumSubscriptionGroupRole.UNSPECIFIED;
|
|
}
|
|
return prop;
|
|
},
|
|
set: undefined
|
|
});
|
|
const userRecord = new UserRecord({ id: "0" });
|
|
let size = fn(2);
|
|
let result = size.fileFinishedImporting("records/UserRecord.tsx");
|
|
|
|
export default UserRecord;
|
|
export const PLACEHOLDER_USER_RECORD = userRecord;
|