UNPKG

@evolvejs/core

Version:

An advanced Discord API wrapper with TS and JS support

39 lines (38 loc) 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PresenceUpdate = void 0; /* eslint-disable @typescript-eslint/no-non-null-assertion */ const __1 = require("../.."); const objex_1 = require("@evolvejs/objex"); class PresenceUpdate { constructor(data, client) { this.roles = new objex_1.Objex(); Object.defineProperty(this, "data", { value: data, enumerable: false, writable: false, }); Object.defineProperty(this, "client", { value: client, enumerable: false, writable: false, }); this._handle(); } _handle() { if (!this.data) return; this.user = new __1.User(this.data.user); this.data.roles.forEach((o) => this.roles.set(o, this.client.roles.get(o))); if (this.data.game) this.game = new __1.Activity(this.data.game); this.guildId = this.data.guild_id; this.status = this.data.status; this.activities = this.data.activities; this.clientStatus = new __1.ClientStatus(this.data.client_status); this.premiumFrom = this.data.premium_since; this.nick = this.data.nick; return this; } } exports.PresenceUpdate = PresenceUpdate;