-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): add
ChannelAgeGate
node
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Parser } from '../index.js'; | ||
import Button from './Button.js'; | ||
import Text from './misc/Text.js'; | ||
import Thumbnail from './misc/Thumbnail.js'; | ||
|
||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
|
||
class ChannelAgeGate extends YTNode { | ||
static type = 'channelAgeGate'; | ||
|
||
channel_title: string; | ||
avatar: Thumbnail[]; | ||
header: Text; | ||
main_text: Text; | ||
sign_in_button: Button | null; | ||
secondary_text: Text; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.channel_title = data.channelTitle; | ||
this.avatar = Thumbnail.fromResponse(data.avatar); | ||
this.header = new Text(data.header); | ||
this.main_text = new Text(data.mainText); | ||
this.sign_in_button = Parser.parseItem<Button>(data.signInButton, Button); | ||
this.secondary_text = new Text(data.secondaryText); | ||
} | ||
} | ||
|
||
export default ChannelAgeGate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters