@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
56 lines (55 loc) • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubChannelChatSharedChatRaidNotificationEvent = 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 another channel's chat during a shared chat session.
*/
let EventSubChannelChatSharedChatRaidNotificationEvent = class EventSubChannelChatSharedChatRaidNotificationEvent extends EventSubChannelChatBaseNotificationEvent_1.EventSubChannelChatBaseNotificationEvent {
constructor() {
super(...arguments);
this.type = 'shared_chat_raid';
}
/**
* The ID of the user that raided the channel.
*/
get raiderId() {
return this[common_1.rawDataSymbol].shared_chat_raid.user_id;
}
/**
* The username of the user that raided the channel.
*/
get raiderName() {
return this[common_1.rawDataSymbol].shared_chat_raid.user_login;
}
/**
* The display name of the user that raided the channel.
*/
get raiderDisplayName() {
return this[common_1.rawDataSymbol].shared_chat_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].shared_chat_raid.user_id));
}
/**
* The amount of viewers the channel was raided with.
*/
get viewerCount() {
return this[common_1.rawDataSymbol].shared_chat_raid.viewer_count;
}
/**
* The URL to the profile image of the user that raided the channel.
*/
get raiderProfileImageUrl() {
return this[common_1.rawDataSymbol].shared_chat_raid.profile_image_url;
}
};
exports.EventSubChannelChatSharedChatRaidNotificationEvent = EventSubChannelChatSharedChatRaidNotificationEvent;
exports.EventSubChannelChatSharedChatRaidNotificationEvent = EventSubChannelChatSharedChatRaidNotificationEvent = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubChannelChatSharedChatRaidNotificationEvent', 'broadcasterId')
], EventSubChannelChatSharedChatRaidNotificationEvent);