-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): Add
LiveChatSponsorshipsGiftRedemptionAnnouncement
node
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/parser/classes/livechat/items/LiveChatSponsorshipsGiftRedemptionAnnouncement.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters