@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
50 lines (49 loc) • 1.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubChannelRaidModerationEvent = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@twurple/common");
const EventSubChannelBaseModerationEvent_1 = require("./EventSubChannelBaseModerationEvent");
/**
* An EventSub event representing a moderator starting a raid on a channel.
*/
let EventSubChannelRaidModerationEvent = class EventSubChannelRaidModerationEvent extends EventSubChannelBaseModerationEvent_1.EventSubChannelBaseModerationEvent {
constructor() {
super(...arguments);
this.moderationAction = 'raid';
}
/**
* The ID of the user being raided.
*/
get userId() {
return this[common_1.rawDataSymbol].raid.user_id;
}
/**
* The name of the user being raided.
*/
get userName() {
return this[common_1.rawDataSymbol].raid.user_login;
}
/**
* The display name of the user being raided.
*/
get userDisplayName() {
return this[common_1.rawDataSymbol].raid.user_name;
}
/**
* Gets more information about the user.
*/
async getUser() {
return await this._client.users.getUserById(this[common_1.rawDataSymbol].raid.user_id);
}
/**
* The number of viewers who came with the raid.
*/
get viewerCount() {
return this[common_1.rawDataSymbol].raid.viewer_count;
}
};
exports.EventSubChannelRaidModerationEvent = EventSubChannelRaidModerationEvent;
exports.EventSubChannelRaidModerationEvent = EventSubChannelRaidModerationEvent = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubChannelRaidModerationEvent', 'broadcasterId')
], EventSubChannelRaidModerationEvent);