@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
41 lines (40 loc) • 1.45 kB
JavaScript
import { __decorate } from "tslib";
import { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';
/**
* The broadcaster participating in the shared Hype Train.
*/
let EventSubChannelHypeTrainSharedParticipant = class EventSubChannelHypeTrainSharedParticipant extends DataObject {
_client;
constructor(data, _client) {
super(data);
this._client = _client;
}
/**
* The ID of the broadcaster participating in the shared Hype Train.
*/
get broadcasterId() {
return this[rawDataSymbol].broadcaster_user_id;
}
/**
* The name of the broadcaster participating in the shared Hype Train.
*/
get broadcasterName() {
return this[rawDataSymbol].broadcaster_user_login;
}
/**
* The display name of the broadcaster participating in the shared Hype Train.
*/
get broadcasterDisplayName() {
return this[rawDataSymbol].broadcaster_user_name;
}
/**
* Gets more information about the broadcaster.
*/
async getBroadcaster() {
return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id));
}
};
EventSubChannelHypeTrainSharedParticipant = __decorate([
rtfm('eventsub-base', 'EventSubChannelHypeTrainSharedParticipant', 'broadcasterId')
], EventSubChannelHypeTrainSharedParticipant);
export { EventSubChannelHypeTrainSharedParticipant };