@evolvejs/core
Version:
An advanced Discord API wrapper with TS and JS support
38 lines (37 loc) • 1.42 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0;
const __1 = require("../..");
class User {
constructor(data) {
Object.defineProperty(this, "data", {
value: data,
enumerable: false,
writable: false,
});
this._handle();
}
_handle() {
var _a, _b, _c, _d, _e, _f;
if (!this.data)
return;
if (this.data.id)
this.id = this.data.id;
this.username = this.data.username;
this.discriminator = this.data.discriminator;
this.avatar = (_a = this.data.avatar) !== null && _a !== void 0 ? _a : undefined;
this.bot = (_b = this.data.bot) !== null && _b !== void 0 ? _b : false;
this.system = (_c = this.data.system) !== null && _c !== void 0 ? _c : false;
this.twoFactor = (_d = this.data.mfa_enabled) !== null && _d !== void 0 ? _d : false;
this.lang = this.data.locale;
this.verified = (_e = this.data.verified) !== null && _e !== void 0 ? _e : false;
this.email = (_f = this.data.email) !== null && _f !== void 0 ? _f : undefined;
this.flags = this.data.flags;
this.premiumType = this.data.premium_type
? __1.NITRO[this.data.premium_type]
: "None";
this.publicFlags = this.data.public_flags;
return this;
}
}
exports.User = User;