UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

30 lines (29 loc) 1.41 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubSubscription } from "./EventSubSubscription.mjs"; import { EventSubChannelUnbanRequestResolveEvent } from "../events/EventSubChannelUnbanRequestResolveEvent.mjs"; /** @internal */ let EventSubChannelUnbanRequestResolveSubscription = class EventSubChannelUnbanRequestResolveSubscription extends 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(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())); } }; EventSubChannelUnbanRequestResolveSubscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubChannelUnbanRequestResolveSubscription); export { EventSubChannelUnbanRequestResolveSubscription };