UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

33 lines (32 loc) 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelUnbanRequestResolveSubscription = void 0; const tslib_1 = require("tslib"); const common_1 = require("@twurple/common"); const EventSubSubscription_1 = require("./EventSubSubscription"); const EventSubChannelUnbanRequestResolveEvent_1 = require("../events/EventSubChannelUnbanRequestResolveEvent"); /** @internal */ let EventSubChannelUnbanRequestResolveSubscription = class EventSubChannelUnbanRequestResolveSubscription extends EventSubSubscription_1.EventSubSubscription { constructor(handler, client, _broadcasterId, _moderatorId) { super(handler, client); this._broadcasterId = _broadcasterId; this._moderatorId = _moderatorId; /** @protected */ this._cliName = ''; } get id() { return `channel.unban_request.resolve.${this._broadcasterId}.${this._moderatorId}`; } get authUserId() { return this._moderatorId; } transformData(data) { return new EventSubChannelUnbanRequestResolveEvent_1.EventSubChannelUnbanRequestResolveEvent(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.asUser(this._moderatorId, async (ctx) => await ctx.eventSub.subscribeToChannelUnbanRequestResolveEvents(this._broadcasterId, await this._getTransportOptions())); } }; exports.EventSubChannelUnbanRequestResolveSubscription = EventSubChannelUnbanRequestResolveSubscription; exports.EventSubChannelUnbanRequestResolveSubscription = EventSubChannelUnbanRequestResolveSubscription = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubSubscription') ], EventSubChannelUnbanRequestResolveSubscription);