@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
33 lines (32 loc) • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubChannelChatUserMessageUpdateSubscription = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@twurple/common");
const EventSubSubscription_1 = require("./EventSubSubscription");
const EventSubChannelChatUserMessageUpdateEvent_1 = require("../events/EventSubChannelChatUserMessageUpdateEvent");
/** @internal */
let EventSubChannelChatUserMessageUpdateSubscription = class EventSubChannelChatUserMessageUpdateSubscription extends EventSubSubscription_1.EventSubSubscription {
constructor(handler, client, _broadcasterId, _userId) {
super(handler, client);
this._broadcasterId = _broadcasterId;
this._userId = _userId;
/** @protected */ this._cliName = '';
}
get id() {
return `channel.chat.user_message_update.${this._broadcasterId}.${this._userId}`;
}
get authUserId() {
return this._userId;
}
transformData(data) {
return new EventSubChannelChatUserMessageUpdateEvent_1.EventSubChannelChatUserMessageUpdateEvent(data, this._client._apiClient);
}
async _subscribe() {
return await this._client._apiClient.asUser(this._userId, async (ctx) => await ctx.eventSub.subscribeToChannelChatUserMessageUpdateEvents(this._broadcasterId, await this._getTransportOptions()));
}
};
exports.EventSubChannelChatUserMessageUpdateSubscription = EventSubChannelChatUserMessageUpdateSubscription;
exports.EventSubChannelChatUserMessageUpdateSubscription = EventSubChannelChatUserMessageUpdateSubscription = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubSubscription')
], EventSubChannelChatUserMessageUpdateSubscription);