UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

33 lines (32 loc) 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventSubChannelSuspiciousUserMessageSubscription = void 0; const tslib_1 = require("tslib"); const common_1 = require("@twurple/common"); const EventSubSubscription_1 = require("./EventSubSubscription"); const EventSubChannelSuspiciousUserMessageEvent_1 = require("../events/EventSubChannelSuspiciousUserMessageEvent"); /** @internal */ let EventSubChannelSuspiciousUserMessageSubscription = class EventSubChannelSuspiciousUserMessageSubscription 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.suspicious_user.message.${this._broadcasterId}.${this._moderatorId}`; } get authUserId() { return this._moderatorId; } transformData(data) { return new EventSubChannelSuspiciousUserMessageEvent_1.EventSubChannelSuspiciousUserMessageEvent(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.asUser(this._moderatorId, async (ctx) => await ctx.eventSub.subscribeToChannelSuspiciousUserMessageEvents(this._broadcasterId, await this._getTransportOptions())); } }; exports.EventSubChannelSuspiciousUserMessageSubscription = EventSubChannelSuspiciousUserMessageSubscription; exports.EventSubChannelSuspiciousUserMessageSubscription = EventSubChannelSuspiciousUserMessageSubscription = tslib_1.__decorate([ (0, common_1.rtfm)('eventsub-base', 'EventSubSubscription') ], EventSubChannelSuspiciousUserMessageSubscription);