UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

38 lines (37 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelChatSubNotificationEvent = void 0; const tslib_1 = require("tslib"); const common_1 = require("@twurple/common"); const EventSubChannelChatBaseNotificationEvent_1 = require("./EventSubChannelChatBaseNotificationEvent"); /** * An EventSub event representing a sub notification in a channel's chat. */ let EventSubChannelChatSubNotificationEvent = class EventSubChannelChatSubNotificationEvent extends EventSubChannelChatBaseNotificationEvent_1.EventSubChannelChatBaseNotificationEvent { constructor() { super(...arguments); this.type = 'sub'; } /** * The tier of the subscription. */ get tier() { return this[common_1.rawDataSymbol].sub.sub_tier; } /** * Whether the subscription was "paid" for using Prime Gaming. */ get isPrime() { return this[common_1.rawDataSymbol].sub.is_prime; } /** * The number of months the subscription is for. */ get durationMonths() { return this[common_1.rawDataSymbol].sub.duration_months; } }; exports.EventSubChannelChatSubNotificationEvent = EventSubChannelChatSubNotificationEvent; exports.EventSubChannelChatSubNotificationEvent = EventSubChannelChatSubNotificationEvent = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubChannelChatResubNotificationEvent', 'broadcasterId') ], EventSubChannelChatSubNotificationEvent);