@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
35 lines (34 loc) • 1.19 kB
JavaScript
import { __decorate } from "tslib";
import { rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelChatBaseNotificationEvent } from "./EventSubChannelChatBaseNotificationEvent.mjs";
/**
* An EventSub event representing a sub notification in a channel's chat.
*/
let EventSubChannelChatSubNotificationEvent = class EventSubChannelChatSubNotificationEvent extends EventSubChannelChatBaseNotificationEvent {
constructor() {
super(...arguments);
this.type = 'sub';
}
/**
* The tier of the subscription.
*/
get tier() {
return this[rawDataSymbol].sub.sub_tier;
}
/**
* Whether the subscription was "paid" for using Prime Gaming.
*/
get isPrime() {
return this[rawDataSymbol].sub.is_prime;
}
/**
* The number of months the subscription is for.
*/
get durationMonths() {
return this[rawDataSymbol].sub.duration_months;
}
};
EventSubChannelChatSubNotificationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelChatResubNotificationEvent', 'broadcasterId')
], EventSubChannelChatSubNotificationEvent);
export { EventSubChannelChatSubNotificationEvent };