Files
YouTube.js/lib/parser/classes/livechat/items/LiveChatPaidSticker.js
LuanRT 68cb841c00 refactor!: finish parser migration
Finally! :)

This removes all code related to the old parser.

#65
2022-07-11 06:19:10 -03:00

28 lines
836 B
JavaScript

'use strict';
const Parser = require('../../..');
const NavigationEndpoint = require('../../NavigationEndpoint');
const Thumbnail = require('../../Thumbnail');
const Text = require('../../Text');
class LiveChatPaidSticker {
type = 'LiveChatPaidSticker';
constructor(data) {
this.id = data.id;
this.author = {
id: data.authorExternalChannelId,
name: new Text(data.authorName),
thumbnails: Thumbnail.fromResponse(data.authorPhoto),
badges: Parser.parse(data.authorBadges)
};
this.sticker = Thumbnail.fromResponse(data.sticker);
this.purchase_amount = new Text(data.purchaseAmountText).toString();
this.context_menu = new NavigationEndpoint(data.contextMenuEndpoint);
this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000);
}
}
module.exports = LiveChatPaidSticker;