UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

32 lines (31 loc) 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelAutomaticRewardRedemptionAddV2Subscription = void 0; const tslib_1 = require("tslib"); const common_1 = require("@twurple/common"); const EventSubSubscription_1 = require("./EventSubSubscription"); const EventSubChannelAutomaticRewardRedemptionAddV2Event_1 = require("../events/EventSubChannelAutomaticRewardRedemptionAddV2Event"); /** @internal */ let EventSubChannelAutomaticRewardRedemptionAddV2Subscription = class EventSubChannelAutomaticRewardRedemptionAddV2Subscription extends EventSubSubscription_1.EventSubSubscription { constructor(handler, client, _userId) { super(handler, client); this._userId = _userId; /** @protected */ this._cliName = ''; } get id() { return `channel.channel_points_automatic_reward_redemption.add.v2.${this._userId}`; } get authUserId() { return this._userId; } transformData(data) { return new EventSubChannelAutomaticRewardRedemptionAddV2Event_1.EventSubChannelAutomaticRewardRedemptionAddV2Event(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.eventSub.subscribeToChannelAutomaticRewardRedemptionAddV2Events(this._userId, await this._getTransportOptions()); } }; exports.EventSubChannelAutomaticRewardRedemptionAddV2Subscription = EventSubChannelAutomaticRewardRedemptionAddV2Subscription; exports.EventSubChannelAutomaticRewardRedemptionAddV2Subscription = EventSubChannelAutomaticRewardRedemptionAddV2Subscription = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubSubscription') ], EventSubChannelAutomaticRewardRedemptionAddV2Subscription);