@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
32 lines (31 loc) • 1.46 kB
JavaScript
import { __decorate } from "tslib";
import { rtfm } from '@twurple/common';
import { EventSubSubscription } from './EventSubSubscription.js';
import { EventSubChannelSuspiciousUserMessageEvent } from '../events/EventSubChannelSuspiciousUserMessageEvent.js';
/** @internal */
let EventSubChannelSuspiciousUserMessageSubscription = class EventSubChannelSuspiciousUserMessageSubscription extends EventSubSubscription {
_broadcasterId;
_moderatorId;
/** @protected */ _cliName = '';
constructor(handler, client, _broadcasterId, _moderatorId) {
super(handler, client);
this._broadcasterId = _broadcasterId;
this._moderatorId = _moderatorId;
}
get id() {
return `channel.suspicious_user.message.${this._broadcasterId}.${this._moderatorId}`;
}
get authUserId() {
return this._moderatorId;
}
transformData(data) {
return new 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()));
}
};
EventSubChannelSuspiciousUserMessageSubscription = __decorate([
rtfm('eventsub-base', 'EventSubSubscription')
], EventSubChannelSuspiciousUserMessageSubscription);
export { EventSubChannelSuspiciousUserMessageSubscription };