@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
38 lines (37 loc) • 1.46 kB
JavaScript
import { __decorate } from "tslib";
import { rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelChatBaseNotificationEvent } from './EventSubChannelChatBaseNotificationEvent.js';
/**
* An EventSub event representing a community sub gift notification in a channel's chat.
*/
let EventSubChannelChatCommunitySubGiftNotificationEvent = class EventSubChannelChatCommunitySubGiftNotificationEvent extends EventSubChannelChatBaseNotificationEvent {
type = 'community_sub_gift';
/**
* The ID of the community sub gift.
*/
get id() {
return this[rawDataSymbol].community_sub_gift.id;
}
/**
* The tier of the subscriptions.
*/
get tier() {
return this[rawDataSymbol].community_sub_gift.sub_tier;
}
/**
* The amount of gifts that are part of this community sub gift.
*/
get amount() {
return this[rawDataSymbol].community_sub_gift.total;
}
/**
* The amount of gifts that the gifter has sent in total, or `null` the gift is anonymous.
*/
get cumulativeAmount() {
return this[rawDataSymbol].community_sub_gift.cumulative_total;
}
};
EventSubChannelChatCommunitySubGiftNotificationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelChatCommunitySubGiftNotificationEvent', 'broadcasterId')
], EventSubChannelChatCommunitySubGiftNotificationEvent);
export { EventSubChannelChatCommunitySubGiftNotificationEvent };