UNPKG

@twitchfy/chatbot

Version:

A powerful node module to make your own Twitch ChatBot

64 lines (63 loc) 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CheermoteTier = void 0; const Base_1 = require("./Base"); /** * Represents a Twitch cheermote tier. */ class CheermoteTier extends Base_1.Base { /** * The cheermote of the tier. */ cheermote; /** * Whether the user can cheer with this tier. */ canCheer; /** * The color of the tier. */ color; /** * The minimum bits necessary to cheer with this tier. */ minBits; /** * Whether the tier should be shown in the bits card. */ showInBitsCard; /** * The data of the cheermote tier returned from the API. */ data; /** * Creates a new instance of the cheermote tier. * @param chatbot The current instance of the chatbot. * @param cheermote The cheermote of the tier. * @param data The data of the cheermote tier returned from the API. */ constructor(chatbot, cheermote, data) { super(chatbot); this.data = data; this.cheermote = cheermote; this.canCheer = data.can_cheer; this.color = data.color; this.minBits = data.min_bits; this.showInBitsCard = data.show_in_bits_card; } /** * The Id of the cheermote tier. */ get id() { return Number(this.data.id); } /** * Get the URL of the image of the cheermote tier. * @param options The options to get the URL of the cheermote tier. * @returns The URL of the image of the cheermote tier. */ getURL(options) { return this.data.images[options?.theme ?? 'light'][options?.format ?? 'static'][options?.size ?? '1']; } } exports.CheermoteTier = CheermoteTier;