UNPKG

@twurple/eventsub-base

Version:

Base for the other Twurple EventSub packages

28 lines (27 loc) 1.18 kB
import { __decorate } from "tslib"; import { rtfm } from '@twurple/common'; import { EventSubUserAuthorizationRevokeEvent } from '../events/EventSubUserAuthorizationRevokeEvent.js'; import { EventSubSubscription } from './EventSubSubscription.js'; /** @internal */ let EventSubUserAuthorizationRevokeSubscription = class EventSubUserAuthorizationRevokeSubscription extends EventSubSubscription { _userId; /** @protected */ _cliName = 'revoke'; authUserId = null; constructor(handler, client, _userId) { super(handler, client); this._userId = _userId; } get id() { return `user.authorization.revoke.${this._userId}`; } transformData(data) { return new EventSubUserAuthorizationRevokeEvent(data, this._client._apiClient); } async _subscribe() { return await this._client._apiClient.eventSub.subscribeToUserAuthorizationRevokeEvents(this._userId, await this._getTransportOptions()); } }; EventSubUserAuthorizationRevokeSubscription = __decorate([ rtfm('eventsub-base', 'EventSubSubscription') ], EventSubUserAuthorizationRevokeSubscription); export { EventSubUserAuthorizationRevokeSubscription };