-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(LiveChatPaidMessage): Parse
headerOverlayImage
and `lowerBumpe…
…r` (#851) * feat(LiveChatPaidMessage): Parse `headerOverlayImage` and `lowerBumper` When a viewer donates for the 1st, 3rd, 5th, 10th, or 20th time, there will be a special type of `LiveChatPaidMessage` that includes an animated image in the header, followed by a bumper text message. * chore: npm run build:parser-map
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/parser/classes/livechat/items/BumperUserEduContentView.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,18 @@ | ||
import { YTNode } from '../../../helpers.js'; | ||
import { type RawNode } from '../../../index.js'; | ||
import Text from '../../misc/Text.js'; | ||
|
||
export default class BumperUserEduContentView extends YTNode { | ||
static type = 'BumperUserEduContentView'; | ||
|
||
text: Text; | ||
image_name: string; | ||
image_color: number; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.text = Text.fromAttributed(data.text); | ||
this.image_name = data.image.sources[0].clientResource.imageName; | ||
this.image_color = data.image.sources[0].clientResource.imageColor; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/parser/classes/livechat/items/LiveChatItemBumperView.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,14 @@ | ||
import { YTNode } from '../../../helpers.js'; | ||
import { Parser, type RawNode } from '../../../index.js'; | ||
import BumperUserEduContentView from './BumperUserEduContentView.js'; | ||
|
||
export default class LiveChatItemBumperView extends YTNode { | ||
static type = 'LiveChatItemBumperView'; | ||
|
||
content: BumperUserEduContentView | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.content = Parser.parseItem(data.content, BumperUserEduContentView); | ||
} | ||
} |
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
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