mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user