mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +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:
25
src/parser/classes/UpsellDialog.ts
Normal file
25
src/parser/classes/UpsellDialog.ts
Normal 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;
|
||||
Reference in New Issue
Block a user