@evolvejs/core
Version:
An advanced Discord API wrapper with TS and JS support
36 lines (35 loc) • 1.23 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NewsChannel = void 0;
const __1 = require("../..");
const objex_1 = require("@evolvejs/objex");
const Channel_1 = require("./Channel");
class NewsChannel extends Channel_1.Channel {
constructor(data, client) {
super(data.id, __1.CHANNELTYPES.News, client);
this.overwrites = new objex_1.Objex();
this.nsfw = false;
Object.defineProperty(this, "data", {
value: data,
enumerable: false,
writable: false,
});
this._handle();
}
_handle() {
var _a;
if (!this.data)
return;
this.guild = this.client.guilds.get(this.data.guild_id);
this.position = this.data.position;
this.name = this.data.name;
this.topic = (_a = this.data.topic) !== null && _a !== void 0 ? _a : "";
this.nsfw = this.data.nsfw;
this.lastMessage = this.data.last_message_id || undefined;
this.rateLimit = this.data.rate_limit_per_user;
this.parentID = this.data.parent_id;
this.lastPin = this.data.last_message_id || undefined;
return this;
}
}
exports.NewsChannel = NewsChannel;