@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
50 lines (49 loc) • 1.76 kB
JavaScript
import { __decorate } from "tslib";
import { checkRelationAssertion, rawDataSymbol, rtfm } from '@twurple/common';
import { EventSubChannelChatBaseNotificationEvent } from './EventSubChannelChatBaseNotificationEvent.js';
/**
* An EventSub event representing an incoming raid notification in a channel's chat.
*/
let EventSubChannelChatRaidNotificationEvent = class EventSubChannelChatRaidNotificationEvent extends EventSubChannelChatBaseNotificationEvent {
type = 'raid';
/**
* The ID of the user that raided the channel.
*/
get raiderId() {
return this[rawDataSymbol].raid.user_id;
}
/**
* The username of the user that raided the channel.
*/
get raiderName() {
return this[rawDataSymbol].raid.user_login;
}
/**
* The display name of the user that raided the channel.
*/
get raiderDisplayName() {
return this[rawDataSymbol].raid.user_name;
}
/**
* Gets more information about the user that raided the channel.
*/
async getRaider() {
return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].raid.user_id));
}
/**
* The amount of viewers the channel was raided with.
*/
get viewerCount() {
return this[rawDataSymbol].raid.viewer_count;
}
/**
* The URL to the profile image of the user that raided the channel.
*/
get raiderProfileImageUrl() {
return this[rawDataSymbol].raid.profile_image_url;
}
};
EventSubChannelChatRaidNotificationEvent = __decorate([
rtfm('eventsub-base', 'EventSubChannelChatRaidNotificationEvent', 'broadcasterId')
], EventSubChannelChatRaidNotificationEvent);
export { EventSubChannelChatRaidNotificationEvent };