mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-27 00:29:16 +00:00
feat(livechat): add LiveChatPaidSticker action
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
'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;
|
||||
Reference in New Issue
Block a user