UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

29 lines (28 loc) 1.35 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubSubscription } from "./EventSubSubscription.mjs"; import { EventSubChannelAutomaticRewardRedemptionAddEvent } from "../events/EventSubChannelAutomaticRewardRedemptionAddEvent.mjs"; /** @internal */ let EventSubChannelAutomaticRewardRedemptionAddSubscription = class EventSubChannelAutomaticRewardRedemptionAddSubscription extends EventSubSubscription { constructor(handler, client, _userId) { super(handler, client); this._userId = _userId; /** @protected */ this._cliName = ''; } get id() { return `channel.channel_points_automatic_reward_redemption.add.${this._userId}`; } get authUserId() { return this._userId; } transformData(data) { return new EventSubChannelAutomaticRewardRedemptionAddEvent(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.eventSub.subscribeToChannelAutomaticRewardRedemptionAddEvents(this._userId, await this._getTransportOptions()); } }; EventSubChannelAutomaticRewardRedemptionAddSubscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubChannelAutomaticRewardRedemptionAddSubscription); export { EventSubChannelAutomaticRewardRedemptionAddSubscription };