UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

46 lines (45 loc) 2.01 kB
import { __decorate } from "tslib"; import { mapNullable } from '@d-fischer/shared-utils'; import { rawDataSymbol, rtfm } from '@twurple/common'; import { EventSubChannelChatBaseNotificationEvent } from './EventSubChannelChatBaseNotificationEvent.js'; /** * An EventSub event representing a notification of a user "paying it forward" in another channel's chat during a shared * chat session. */ let EventSubChannelChatSharedChatPayItForwardNotificationEvent = class EventSubChannelChatSharedChatPayItForwardNotificationEvent extends EventSubChannelChatBaseNotificationEvent { type = 'shared_chat_pay_it_forward'; /** * Whether the original gifter is anonymous. */ get isGifterAnonymous() { return this[rawDataSymbol].shared_chat_pay_it_forward.gifter_is_anonymous; } /** * The ID of the original gifter, or `null` if they're anonymous. */ get gifterId() { return this[rawDataSymbol].shared_chat_pay_it_forward.gifter_user_id; } /** * The username of the original gifter, or `null` if they're anonymous. */ get gifterName() { return this[rawDataSymbol].shared_chat_pay_it_forward.gifter_user_login; } /** * The display name of the original gifter, or `null` if they're anonymous. */ get gifterDisplayName() { return this[rawDataSymbol].shared_chat_pay_it_forward.gifter_user_name; } /** * Gets more information about the original gifter, or `null` if they're anonymous. */ async getGifter() { return await mapNullable(this[rawDataSymbol].shared_chat_pay_it_forward.gifter_user_id, async (id) => await this._client.users.getUserById(id)); } }; EventSubChannelChatSharedChatPayItForwardNotificationEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelChatSharedChatPayItForwardNotificationEvent', 'broadcasterId') ], EventSubChannelChatSharedChatPayItForwardNotificationEvent); export { EventSubChannelChatSharedChatPayItForwardNotificationEvent };