Skip to content

Commit

Permalink
feat(parser): Add LiveChatSponsorshipsGiftRedemptionAnnouncement no…
Browse files Browse the repository at this point in the history
…de (#795)
  • Loading branch information
jonz94 authored Nov 9, 2024
1 parent b83a32f commit 20f7971
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { YTNode } from '../../../helpers.js';
import type { RawNode } from '../../../index.js';
import NavigationEndpoint from '../../NavigationEndpoint.js';
import Author from '../../misc/Author.js';
import Text from '../../misc/Text.js';

export default class LiveChatSponsorshipsGiftRedemptionAnnouncement extends YTNode {
static type = 'LiveChatSponsorshipsGiftRedemptionAnnouncement';

id: string;
timestamp_usec: string;
timestamp_text: Text;
author: Author;
message: Text;
menu_endpoint: NavigationEndpoint;
context_menu_accessibility_label: string;

constructor(data: RawNode) {
super();
this.id = data.id;
this.timestamp_usec = data.timestampUsec;
this.timestamp_text = new Text(data.timestampText);

this.author = new Author(
data.authorName,
data.authorBadges,
data.authorPhoto,
data.authorExternalChannelId
);

this.message = new Text(data.message);
this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint);
this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label;
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export { default as LiveChatPlaceholderItem } from './classes/livechat/items/Liv
export { default as LiveChatProductItem } from './classes/livechat/items/LiveChatProductItem.js';
export { default as LiveChatRestrictedParticipation } from './classes/livechat/items/LiveChatRestrictedParticipation.js';
export { default as LiveChatSponsorshipsGiftPurchaseAnnouncement } from './classes/livechat/items/LiveChatSponsorshipsGiftPurchaseAnnouncement.js';
export { default as LiveChatSponsorshipsGiftRedemptionAnnouncement } from './classes/livechat/items/LiveChatSponsorshipsGiftRedemptionAnnouncement.js';
export { default as LiveChatSponsorshipsHeader } from './classes/livechat/items/LiveChatSponsorshipsHeader.js';
export { default as LiveChatTextMessage } from './classes/livechat/items/LiveChatTextMessage.js';
export { default as LiveChatTickerPaidMessageItem } from './classes/livechat/items/LiveChatTickerPaidMessageItem.js';
Expand Down

0 comments on commit 20f7971

Please sign in to comment.