UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

30 lines (29 loc) 1.42 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubSubscription } from "./EventSubSubscription.mjs"; import { EventSubChannelSuspiciousUserUpdateEvent } from "../events/EventSubChannelSuspiciousUserUpdateEvent.mjs"; /** @internal */ let EventSubChannelSuspiciousUserUpdateSubscription = class EventSubChannelSuspiciousUserUpdateSubscription extends EventSubSubscription { constructor(handler, client, _broadcasterId, _moderatorId) { super(handler, client); this._broadcasterId = _broadcasterId; this._moderatorId = _moderatorId; /** @protected */ this._cliName = ''; } get id() { return `channel.suspicious_user.update.${this._broadcasterId}.${this._moderatorId}`; } get authUserId() { return this._moderatorId; } transformData(data) { return new EventSubChannelSuspiciousUserUpdateEvent(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.asUser(this._moderatorId, async (ctx) => await ctx.eventSub.subscribeToChannelSuspiciousUserUpdateEvents(this._broadcasterId, await this._getTransportOptions())); } }; EventSubChannelSuspiciousUserUpdateSubscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubChannelSuspiciousUserUpdateSubscription); export { EventSubChannelSuspiciousUserUpdateSubscription };