UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

34 lines (33 loc) 1.44 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubChannelSharedChatSessionEndEvent } from '../events/EventSubChannelSharedChatSessionEndEvent.js'; import { EventSubSubscription } from './EventSubSubscription.js'; /** @internal */ let EventSubChannelSharedChatSessionEndSubscription = class EventSubChannelSharedChatSessionEndSubscription extends EventSubSubscription { _userId; /** @protected */ _cliName = ''; constructor(handler, client, _userId) { super(handler, client); this._userId = _userId; } get id() { return `channel.shared_chat.end.${this._userId}`; } get authUserId() { return this._userId; } transformData(data) { return this._client._config.managed ? new EventSubChannelSharedChatSessionEndEvent(data, this._client._config.apiClient) : new EventSubChannelSharedChatSessionEndEvent(data); } async _subscribe() { return this._client._config.managed ? await this._client._config.apiClient.eventSub.subscribeToChannelSharedChatSessionEndEvents(this._userId, await this._getTransportOptions()) : undefined; } }; EventSubChannelSharedChatSessionEndSubscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubChannelSharedChatSessionEndSubscription); export { EventSubChannelSharedChatSessionEndSubscription };