UNPKG

@twurple/api

Version:

Interact with Twitch's API.

54 lines (53 loc) 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HelixModeratedChannel = void 0; const tslib_1 = require("tslib"); const shared_utils_1 = require("@d-fischer/shared-utils"); const common_1 = require("@twurple/common"); /** * A reference to a Twitch channel where a user is a moderator. */ let HelixModeratedChannel = class HelixModeratedChannel extends common_1.DataObject { /** @internal */ constructor(data, client) { super(data); this._client = client; } /** * The ID of the channel. */ get id() { return this[common_1.rawDataSymbol].broadcaster_id; } /** * The name of the channel. */ get name() { return this[common_1.rawDataSymbol].broadcaster_login; } /** * The display name of the channel. */ get displayName() { return this[common_1.rawDataSymbol].broadcaster_name; } /** * Gets more information about the channel. */ async getChannel() { return (0, common_1.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[common_1.rawDataSymbol].broadcaster_id)); } /** * Gets more information about the broadcaster of the channel. */ async getBroadcaster() { return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id)); } }; exports.HelixModeratedChannel = HelixModeratedChannel; tslib_1.__decorate([ (0, shared_utils_1.Enumerable)(false) ], HelixModeratedChannel.prototype, "_client", void 0); exports.HelixModeratedChannel = HelixModeratedChannel = tslib_1.__decorate([ (0, common_1.rtfm)('api', 'HelixModeratedChannel', 'id') ], HelixModeratedChannel);