UNPKG

hennus-api

Version:

Esta es una libreria para el bot Hennus

41 lines (40 loc) 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BasedVoiceChannel = void 0; const channel_1 = require("../base/channel"); const utils_1 = require("../../utils"); const Error_1 = require("../../core/Error"); class BasedVoiceChannel extends channel_1.BaseChannel { constructor(data, client) { super(data, client); this.data = data; this.guildId = ""; this.lastMessage = ""; this.bitrate = 0; this.nsfw = false; this.permission = []; this.position = undefined; this.parent = undefined; Object.defineProperty(this, "data", { value: data }); const guild = this.client.guilds.cache.get(this.guildId); if (guild) this.guild = guild; this._cache_messages = new utils_1.MessagesManager(this.client); } get messages() { this._cache_messages.fetchall(this.id); return this._cache_messages; } toJson() { return this.data; } ; async edit(data) { if (data.name && (data.name.length >= 1 && data.name.length <= 100)) throw new Error_1.HennusError(Error_1.errorCodes.ChannelNameLength); return await this.client.channels.edit(this.id, data); } ; } exports.BasedVoiceChannel = BasedVoiceChannel; ;