UNPKG

@twitchfy/chatbot

Version:

A powerful node module to make your own Twitch ChatBot

57 lines (56 loc) 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Channel = void 0; const BaseChannel_1 = require("./BaseChannel"); const ChatRoom_1 = require("./ChatRoom"); /** * Represents a Twitch channel. */ class Channel extends BaseChannel_1.BaseChannel { /** * The game which was currently set into the channel. */ game; /** * The tags of the channel. */ tags; /** * The classification labels of the channel. */ classificationLabels; /** * Whether the channel has branded content. */ isBrandedContent; /** * The data of the channel returned from the API. */ data; /** * Creates a new instance of the channel. * @param chatbot The current instance of the chatbot. * @param data The data of the channel returned from the API. */ constructor(chatbot, data) { super(chatbot, data, new ChatRoom_1.ChatRoom(chatbot, data)); this.data = data; this.game = { id: data.game_id, name: data.game_name }; this.tags = data.tags; this.classificationLabels = data.content_classification_labels; this.isBrandedContent = data.is_branded_content; } /** * The title of the channel. If it was never set, it will return a nullish value. */ get title() { return this.data.title.length ? this.data.title : null; } /** * The language that was set to the channel. */ get language() { return this.data.broadcaster_language; } } exports.Channel = Channel;