UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

50 lines (49 loc) 1.94 kB
import { __decorate } from "tslib"; import { checkRelationAssertion, rawDataSymbol, rtfm } from '@twurple/common'; import { EventSubChannelChatBaseNotificationEvent } from './EventSubChannelChatBaseNotificationEvent.js'; /** * An EventSub event representing an incoming raid notification in another channel's chat during a shared chat session. */ let EventSubChannelChatSharedChatRaidNotificationEvent = class EventSubChannelChatSharedChatRaidNotificationEvent extends EventSubChannelChatBaseNotificationEvent { type = 'shared_chat_raid'; /** * The ID of the user that raided the channel. */ get raiderId() { return this[rawDataSymbol].shared_chat_raid.user_id; } /** * The username of the user that raided the channel. */ get raiderName() { return this[rawDataSymbol].shared_chat_raid.user_login; } /** * The display name of the user that raided the channel. */ get raiderDisplayName() { return this[rawDataSymbol].shared_chat_raid.user_name; } /** * Gets more information about the user that raided the channel. */ async getRaider() { return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].shared_chat_raid.user_id)); } /** * The amount of viewers the channel was raided with. */ get viewerCount() { return this[rawDataSymbol].shared_chat_raid.viewer_count; } /** * The URL to the profile image of the user that raided the channel. */ get raiderProfileImageUrl() { return this[rawDataSymbol].shared_chat_raid.profile_image_url; } }; EventSubChannelChatSharedChatRaidNotificationEvent = __decorate([ rtfm('eventsub-base', 'EventSubChannelChatSharedChatRaidNotificationEvent', 'broadcasterId') ], EventSubChannelChatSharedChatRaidNotificationEvent); export { EventSubChannelChatSharedChatRaidNotificationEvent };