@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
56 lines (55 loc) • 2.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubChannelChatRaidNotificationEvent = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@twurple/common");
const EventSubChannelChatBaseNotificationEvent_1 = require("./EventSubChannelChatBaseNotificationEvent");
/**
* An EventSub event representing an incoming raid notification in a channel's chat.
*/
let EventSubChannelChatRaidNotificationEvent = class EventSubChannelChatRaidNotificationEvent extends EventSubChannelChatBaseNotificationEvent_1.EventSubChannelChatBaseNotificationEvent {
constructor() {
super(...arguments);
this.type = 'raid';
}
/**
* The ID of the user that raided the channel.
*/
get raiderId() {
return this[common_1.rawDataSymbol].raid.user_id;
}
/**
* The username of the user that raided the channel.
*/
get raiderName() {
return this[common_1.rawDataSymbol].raid.user_login;
}
/**
* The display name of the user that raided the channel.
*/
get raiderDisplayName() {
return this[common_1.rawDataSymbol].raid.user_name;
}
/**
* Gets more information about the user that raided the channel.
*/
async getRaider() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].raid.user_id));
}
/**
* The amount of viewers the channel was raided with.
*/
get viewerCount() {
return this[common_1.rawDataSymbol].raid.viewer_count;
}
/**
* The URL to the profile image of the user that raided the channel.
*/
get raiderProfileImageUrl() {
return this[common_1.rawDataSymbol].raid.profile_image_url;
}
};
exports.EventSubChannelChatRaidNotificationEvent = EventSubChannelChatRaidNotificationEvent;
exports.EventSubChannelChatRaidNotificationEvent = EventSubChannelChatRaidNotificationEvent = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubChannelChatRaidNotificationEvent', 'broadcasterId')
], EventSubChannelChatRaidNotificationEvent);