Something went wrong. Try again.
Gets Twitch, BTTV, FFZ and 7TV emotes as well as parsing text to emotes! kody.tngl.io/twitch-emoticons
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061import Collection from '../util/Collection.js'
class Channel { /** * A Twitch channel. * @param {EmoteFetcher} fetcher - The emote fetcher. * @param {number} id - ID of the channel. */ constructor (fetcher, id) { /** * The emote fetcher. * @type {EmoteFetcher} */ this.fetcher = fetcher
/** * The ID of this channel. * For the global channel, the ID will be null. * @type {number | null} */ this.channel_id = id || null
/** * Cached {@linkcode Emote}s belonging to this channel. * @type {Collection<string, Emote>} */ this.emotes = new Collection() }
/* There are tests that those are returning Collections, but c8 does not get it. */ /* c8 ignore start */
/** * Fetches the BTTV emotes for this channel. * @returns {Promise<Collection<string, BTTVEmote>>} - A promise that resolves to a collection of {@linkcode BTTVEmote}s. */ fetchBTTVEmotes () { return this.fetcher.fetchBTTVEmotes(this.id) }
/** * Fetches the FFZ emotes for this channel. * @returns {Promise<Collection<string, FFZEmote>>} - A promise that resolves to a collection of {@linkcode FFZEmote}s. */ fetchFFZEmotes () { return this.fetcher.fetchFFZEmotes(this.id) }
/** * Fetches the 7TV emotes for this channel. * @returns {Promise<Collection<string, SevenTVEmote>>} - A promise that resolves to a collection of {@linkcode SevenTVEmote}s. */ fetchSevenTVEmotes () { return this.fetcher.fetchSevenTVEmotes(this.id) }
/* c8 ignore end */}
export default Channel