refactor: improve livechat parser & add remaining action nodes (#285)

* refactor: improve live chat parsers & add missing nodes

* chore: update example and docs

* docs: rephrasing/formatting

* chore: remove unneeded test (unrelated)
This commit is contained in:
LuanRT
2023-01-10 01:44:51 -03:00
committed by GitHub
parent 5a362a0bd5
commit 8e37efa575
35 changed files with 413 additions and 182 deletions

View File

@@ -1,6 +1,7 @@
import Text from './misc/Text';
import Parser from '../index';
import Thumbnail from './misc/Thumbnail';
import type Button from './Button';
import { YTNode } from '../helpers';
class LiveChatMessageInput extends YTNode {
@@ -8,14 +9,14 @@ class LiveChatMessageInput extends YTNode {
author_name: Text;
author_photo: Thumbnail[];
send_button;
send_button: Button | null;
target_id: string;
constructor(data: any) {
super();
this.author_name = new Text(data.authorName);
this.author_photo = Thumbnail.fromResponse(data.authorPhoto);
this.send_button = Parser.parse(data.sendButton);
this.send_button = Parser.parseItem<Button>(data.sendButton);
this.target_id = data.targetId;
}
}