UNPKG

@evolvejs/core

Version:

An advanced Discord API wrapper with TS and JS support

36 lines (35 loc) 1.25 kB
"use strict"; /* eslint-disable @typescript-eslint/no-non-null-assertion */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Invite = void 0; const __1 = require("../.."); const Channel_1 = require("../Channel/Channel"); class Invite { constructor(data, client) { 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.code = this.data.code; this.guild = new __1.Guild(this.data.guild, this.client); this.channel = new Channel_1.Channel(this.data.channel.id, this.data.channel.type, this.client); this.inviter = new __1.User(this.data.inviter); this.targetUser = new __1.User(this.data.target_user); this.targetUserType = this.data.target_user_type; this.approxPresenceCount = this.data.approximate_presence_count; this.approxMemberCount = this.data.approximate_member_count; return this; } } exports.Invite = Invite;