@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
67 lines (66 loc) • 2.06 kB
JavaScript
import { __decorate } from "tslib";
import { DataObject, rawDataSymbol, rtfm } from '@twurple/common';
import { Enumerable } from '@d-fischer/shared-utils';
let EventSubChannelBaseModerationEvent = class EventSubChannelBaseModerationEvent extends DataObject {
/** @internal */ _client;
/** @internal */
constructor(data, client) {
super(data);
this._client = client;
}
/**
* The ID of the broadcaster.
*/
get broadcasterId() {
return this[rawDataSymbol].broadcaster_user_id;
}
/**
* The name of the broadcaster.
*/
get broadcasterName() {
return this[rawDataSymbol].broadcaster_user_login;
}
/**
* The display name of the broadcaster.
*/
get broadcasterDisplayName() {
return this[rawDataSymbol].broadcaster_user_name;
}
/**
* Gets more information about the broadcaster.
*/
async getBroadcaster() {
return await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id);
}
/**
* The ID of the moderator who performed the action.
*/
get moderatorId() {
return this[rawDataSymbol].moderator_user_id;
}
/**
* The name of the moderator who performed the action.
*/
get moderatorName() {
return this[rawDataSymbol].moderator_user_login;
}
/**
* The display name of the moderator who performed the action.
*/
get moderatorDisplayName() {
return this[rawDataSymbol].moderator_user_name;
}
/**
* Gets more information about the broadcaster.
*/
async getModerator() {
return await this._client.users.getUserById(this[rawDataSymbol].moderator_user_id);
}
};
__decorate([
Enumerable(false)
], EventSubChannelBaseModerationEvent.prototype, "_client", void 0);
EventSubChannelBaseModerationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelBaseModerationEvent', 'broadcasterId')
], EventSubChannelBaseModerationEvent);
export { EventSubChannelBaseModerationEvent };