@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
39 lines (38 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChannelEmote = void 0;
const Emote_1 = require("./Emote");
/**
* Represents a Twitch channel emote.
*/
class ChannelEmote extends Emote_1.Emote {
/**
* The type of the emote.
*/
type;
/**
* The Id of the emote set.
*/
emoteSetId;
constructor(chatbot, data) {
super(chatbot, data);
this.type = data.emote_type;
this.emoteSetId = data.emote_set_id;
}
/**
* Overrides isChannel method from BaseEmote to assert this as ChannelEmote and not BaseEmote.
* @returns Whether the emote is a channel emote.
*/
isChannel() {
return true;
}
/**
* Returns the subscription tier necessary to use the emote. If the emote is not a subscription emote, it will return null.
*/
get tier() {
if (this.type !== 'subscriptions')
return null;
return Number(this.emoteData.tier[0]);
}
}
exports.ChannelEmote = ChannelEmote;