mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 11:32:27 +00:00
27 lines
780 B
JavaScript
27 lines
780 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('../..');
|
|
const Text = require('../Text');
|
|
const Thumbnail = require('../Thumbnail');
|
|
|
|
class CommentsHeader {
|
|
type = 'CommentsHeader';
|
|
|
|
constructor(data) {
|
|
this.title = new Text(data.titleText);
|
|
this.count = new Text(data.countText);
|
|
this.comments_count = new Text(data.commentsCount);
|
|
this.create_renderer = Parser.parse(data.createRenderer, 'comments');
|
|
this.sort_menu = Parser.parse(data.sortMenu);
|
|
|
|
this.custom_emojis = data.customEmojis?.map((emoji) => ({
|
|
emoji_id: emoji.emojiId,
|
|
shortcuts: emoji.shortcuts,
|
|
search_terms: emoji.searchTerms,
|
|
image: Thumbnail.fromResponse(emoji.image),
|
|
is_custom_emoji: emoji.isCustomEmoji
|
|
})) || null;
|
|
}
|
|
}
|
|
|
|
module.exports = CommentsHeader; |