UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

30 lines (29 loc) 1.28 kB
import { __decorate } from "tslib"; import { rawDataSymbol, rtfm } from '@twurple/common'; import { EventSubChannelCharityAmount } from "../common/EventSubChannelCharityAmount.mjs"; import { EventSubChannelChatBaseNotificationEvent } from "./EventSubChannelChatBaseNotificationEvent.mjs"; /** * An EventSub event representing a notification for a charity donation in a channel's chat. */ let EventSubChannelChatCharityDonationNotificationEvent = class EventSubChannelChatCharityDonationNotificationEvent extends EventSubChannelChatBaseNotificationEvent { constructor() { super(...arguments); this.type = 'charity_donation'; } /** * The name of the charity that was donated to. */ get charityName() { return this[rawDataSymbol].charity_donation.charity_name; } /** * The amount of money that was donated. */ get amount() { return new EventSubChannelCharityAmount(this[rawDataSymbol].charity_donation.amount); } }; EventSubChannelChatCharityDonationNotificationEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelChatCharityDonationNotificationEvent', 'broadcasterId') ], EventSubChannelChatCharityDonationNotificationEvent); export { EventSubChannelChatCharityDonationNotificationEvent };