UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

30 lines (29 loc) 1.21 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubSubscription } from './EventSubSubscription.js'; import { EventSubChannelHypeTrainEndV2Event } from '../events/EventSubChannelHypeTrainEndV2Event.js'; /** @internal */ let EventSubChannelHypeTrainEndV2Subscription = class EventSubChannelHypeTrainEndV2Subscription extends EventSubSubscription { _userId; /** @protected */ _cliName = 'hype-train-end'; constructor(handler, client, _userId) { super(handler, client); this._userId = _userId; } get id() { return `channel.hype_train.end.v2.${this._userId}`; } get authUserId() { return this._userId; } transformData(data) { return new EventSubChannelHypeTrainEndV2Event(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.eventSub.subscribeToChannelHypeTrainEndV2Events(this._userId, await this._getTransportOptions()); } }; EventSubChannelHypeTrainEndV2Subscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubChannelHypeTrainEndV2Subscription); export { EventSubChannelHypeTrainEndV2Subscription };