mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
* refactor: move common info into MediaInfo * refactor: better inference on Memo * refactor: improved typesafety in parser methods * refactor: remove PlaylistAuthor in favor of Author * refactor: cleanup live chat parsers - Replace non standard author type with Author class - Remove redundant code * fix: new errors due to changes * fix: pass actions to FormatUtils#toDash * refactor!: merge NavigatableText and Text into single class
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import Parser from '../../../index.js';
|
|
import Text from '../../misc/Text.js';
|
|
import NavigationEndpoint from '../../NavigationEndpoint.js';
|
|
import type { RawNode } from '../../../index.js';
|
|
|
|
import { YTNode } from '../../../helpers.js';
|
|
import Author from '../../misc/Author.js';
|
|
|
|
class LiveChatTickerPaidMessageItem extends YTNode {
|
|
static type = 'LiveChatTickerPaidMessageItem';
|
|
|
|
author: Author;
|
|
|
|
amount: Text;
|
|
duration_sec: string; // Or number?
|
|
full_duration_sec: string;
|
|
show_item;
|
|
show_item_endpoint: NavigationEndpoint;
|
|
id: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
|
|
this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId);
|
|
|
|
this.amount = new Text(data.amount);
|
|
this.duration_sec = data.durationSec;
|
|
this.full_duration_sec = data.fullDurationSec;
|
|
this.show_item = Parser.parseItem(data.showItemEndpoint?.showLiveChatItemEndpoint?.renderer);
|
|
this.show_item_endpoint = new NavigationEndpoint(data.showItemEndpoint);
|
|
this.id = data.id;
|
|
}
|
|
}
|
|
|
|
export default LiveChatTickerPaidMessageItem; |