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

@@ -0,0 +1,25 @@
import Parser from '..';
import { YTNode } from '../helpers';
import type Button from './Button';
import Text from './misc/Text';
class UpsellDialog extends YTNode {
static type = 'UpsellDialog';
message_title: Text;
message_text: Text;
action_button: Button | null;
dismiss_button: Button | null;
is_visible: boolean;
constructor(data: any) {
super();
this.message_title = new Text(data.dialogMessageTitle);
this.message_text = new Text(data.dialogMessageText);
this.action_button = Parser.parseItem<Button>(data.actionButton);
this.dismiss_button = Parser.parseItem<Button>(data.dismissButton);
this.is_visible = data.isVisible;
}
}
export default UpsellDialog;