@twurple/eventsub-base
Version:
Base for the other Twurple EventSub packages
52 lines (51 loc) • 2.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent = void 0;
const tslib_1 = require("tslib");
const shared_utils_1 = require("@d-fischer/shared-utils");
const common_1 = require("@twurple/common");
const EventSubChannelChatBaseNotificationEvent_1 = require("./EventSubChannelChatBaseNotificationEvent");
/**
* An EventSub event representing a notification of a user upgrading their gifted sub to a paid one in another channel's
* chat during a shared chat session.
*/
let EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent = class EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent extends EventSubChannelChatBaseNotificationEvent_1.EventSubChannelChatBaseNotificationEvent {
constructor() {
super(...arguments);
this.type = 'shared_chat_gift_paid_upgrade';
}
/**
* Whether the original gifter is anonymous.
*/
get isGifterAnonymous() {
return this[common_1.rawDataSymbol].shared_chat_gift_paid_upgrade.gifter_is_anonymous;
}
/**
* The ID of the original gifter, or `null` if they're anonymous.
*/
get gifterId() {
return this[common_1.rawDataSymbol].shared_chat_gift_paid_upgrade.gifter_user_id;
}
/**
* The username of the original gifter, or `null` if they're anonymous.
*/
get gifterName() {
return this[common_1.rawDataSymbol].shared_chat_gift_paid_upgrade.gifter_user_login;
}
/**
* The display name of the original gifter, or `null` if they're anonymous.
*/
get gifterDisplayName() {
return this[common_1.rawDataSymbol].shared_chat_gift_paid_upgrade.gifter_user_name;
}
/**
* Gets more information about the original gifter, or `null` if they're anonymous.
*/
async getGifter() {
return await (0, shared_utils_1.mapNullable)(this[common_1.rawDataSymbol].shared_chat_gift_paid_upgrade.gifter_user_id, async (id) => await this._client.users.getUserById(id));
}
};
exports.EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent = EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent;
exports.EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent = EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent = tslib_1.__decorate([
(0, common_1.rtfm)('eventsub-base', 'EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent', 'broadcasterId')
], EventSubChannelChatSharedChatGiftPaidUpgradeNotificationEvent);