mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 07:42:11 +00:00
chore: clean up build steps
This commit is contained in:
12
src/parser/classes/livechat/AddBannerToLiveChatCommand.js
Normal file
12
src/parser/classes/livechat/AddBannerToLiveChatCommand.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class AddBannerToLiveChatCommand extends YTNode {
|
||||
static type = 'AddBannerToLiveChatCommand';
|
||||
constructor(data) {
|
||||
super();
|
||||
return Parser.parse(data.bannerRenderer);
|
||||
}
|
||||
}
|
||||
export default AddBannerToLiveChatCommand;
|
||||
13
src/parser/classes/livechat/AddChatItemAction.js
Normal file
13
src/parser/classes/livechat/AddChatItemAction.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class AddChatItemAction extends YTNode {
|
||||
static type = 'AddChatItemAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.item = Parser.parseItem(data.item);
|
||||
this.client_id = data.clientId || null;
|
||||
}
|
||||
}
|
||||
export default AddChatItemAction;
|
||||
13
src/parser/classes/livechat/AddLiveChatTickerItemAction.js
Normal file
13
src/parser/classes/livechat/AddLiveChatTickerItemAction.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class AddLiveChatTickerItemAction extends YTNode {
|
||||
static type = 'AddLiveChatTickerItemAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.item = Parser.parseItem(data.item);
|
||||
this.duration_sec = data.durationSec;
|
||||
}
|
||||
}
|
||||
export default AddLiveChatTickerItemAction;
|
||||
14
src/parser/classes/livechat/LiveChatActionPanel.js
Normal file
14
src/parser/classes/livechat/LiveChatActionPanel.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class LiveChatActionPanel extends YTNode {
|
||||
static type = 'LiveChatActionPanel';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.contents = Parser.parse(data.contents);
|
||||
this.target_id = data.targetId;
|
||||
}
|
||||
}
|
||||
export default LiveChatActionPanel;
|
||||
13
src/parser/classes/livechat/MarkChatItemAsDeletedAction.js
Normal file
13
src/parser/classes/livechat/MarkChatItemAsDeletedAction.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class MarkChatItemAsDeletedAction extends YTNode {
|
||||
static type = 'MarkChatItemAsDeletedAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.deleted_state_message = new Text(data.deletedStateMessage);
|
||||
this.target_item_id = data.targetItemId;
|
||||
}
|
||||
}
|
||||
export default MarkChatItemAsDeletedAction;
|
||||
@@ -0,0 +1,13 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class MarkChatItemsByAuthorAsDeletedAction extends YTNode {
|
||||
static type = 'MarkChatItemsByAuthorAsDeletedAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.deleted_state_message = new Text(data.deletedStateMessage);
|
||||
this.channel_id = data.externalChannelId;
|
||||
}
|
||||
}
|
||||
export default MarkChatItemsByAuthorAsDeletedAction;
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class RemoveBannerForLiveChatCommand extends YTNode {
|
||||
static type = 'RemoveBannerForLiveChatCommand';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.target_action_id = data.targetActionId;
|
||||
}
|
||||
}
|
||||
export default RemoveBannerForLiveChatCommand;
|
||||
13
src/parser/classes/livechat/ReplaceChatItemAction.js
Normal file
13
src/parser/classes/livechat/ReplaceChatItemAction.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class ReplaceChatItemAction extends YTNode {
|
||||
static type = 'ReplaceChatItemAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.target_item_id = data.targetItemId;
|
||||
this.replacement_item = Parser.parse(data.replacementItem);
|
||||
}
|
||||
}
|
||||
export default ReplaceChatItemAction;
|
||||
16
src/parser/classes/livechat/ReplayChatItemAction.js
Normal file
16
src/parser/classes/livechat/ReplayChatItemAction.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class ReplayChatItemAction extends YTNode {
|
||||
static type = 'ReplayChatItemAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.actions = Parser.parse(data.actions?.map((action) => {
|
||||
delete action.clickTrackingParams;
|
||||
return action;
|
||||
})) || [];
|
||||
this.video_offset_time_msec = data.videoOffsetTimeMsec;
|
||||
}
|
||||
}
|
||||
export default ReplayChatItemAction;
|
||||
12
src/parser/classes/livechat/ShowLiveChatActionPanelAction.js
Normal file
12
src/parser/classes/livechat/ShowLiveChatActionPanelAction.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class ShowLiveChatActionPanelAction extends YTNode {
|
||||
static type = 'ShowLiveChatActionPanelAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.panel_to_show = Parser.parse(data.panelToShow);
|
||||
}
|
||||
}
|
||||
export default ShowLiveChatActionPanelAction;
|
||||
12
src/parser/classes/livechat/ShowLiveChatTooltipCommand.js
Normal file
12
src/parser/classes/livechat/ShowLiveChatTooltipCommand.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class ShowLiveChatTooltipCommand extends YTNode {
|
||||
static type = 'ShowLiveChatTooltipCommand';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.tooltip = Parser.parse(data.tooltip);
|
||||
}
|
||||
}
|
||||
export default ShowLiveChatTooltipCommand;
|
||||
12
src/parser/classes/livechat/UpdateDateTextAction.js
Normal file
12
src/parser/classes/livechat/UpdateDateTextAction.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateDateTextAction extends YTNode {
|
||||
static type = 'UpdateDateTextAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.date_text = new Text(data.dateText).toString();
|
||||
}
|
||||
}
|
||||
export default UpdateDateTextAction;
|
||||
12
src/parser/classes/livechat/UpdateDescriptionAction.js
Normal file
12
src/parser/classes/livechat/UpdateDescriptionAction.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateDescriptionAction extends YTNode {
|
||||
static type = 'UpdateDescriptionAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.description = new Text(data.description);
|
||||
}
|
||||
}
|
||||
export default UpdateDescriptionAction;
|
||||
12
src/parser/classes/livechat/UpdateLiveChatPollAction.js
Normal file
12
src/parser/classes/livechat/UpdateLiveChatPollAction.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Parser from '../../index';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateLiveChatPollAction extends YTNode {
|
||||
static type = 'UpdateLiveChatPollAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.poll_to_update = Parser.parse(data.pollToUpdate);
|
||||
}
|
||||
}
|
||||
export default UpdateLiveChatPollAction;
|
||||
12
src/parser/classes/livechat/UpdateTitleAction.js
Normal file
12
src/parser/classes/livechat/UpdateTitleAction.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateTitleAction extends YTNode {
|
||||
static type = 'UpdateTitleAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
}
|
||||
}
|
||||
export default UpdateTitleAction;
|
||||
14
src/parser/classes/livechat/UpdateToggleButtonTextAction.js
Normal file
14
src/parser/classes/livechat/UpdateToggleButtonTextAction.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateToggleButtonTextAction extends YTNode {
|
||||
static type = 'UpdateToggleButtonTextAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.default_text = new Text(data.defaultText).toString();
|
||||
this.toggled_text = new Text(data.toggledText).toString();
|
||||
this.button_id = data.buttonId;
|
||||
}
|
||||
}
|
||||
export default UpdateToggleButtonTextAction;
|
||||
15
src/parser/classes/livechat/UpdateViewershipAction.js
Normal file
15
src/parser/classes/livechat/UpdateViewershipAction.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Text from '../misc/Text';
|
||||
|
||||
import { YTNode } from '../../helpers';
|
||||
|
||||
class UpdateViewershipAction extends YTNode {
|
||||
static type = 'UpdateViewershipAction';
|
||||
constructor(data) {
|
||||
super();
|
||||
const view_count_renderer = data.viewCount.videoViewCountRenderer;
|
||||
this.view_count = new Text(view_count_renderer.viewCount);
|
||||
this.extra_short_view_count = new Text(view_count_renderer.extraShortViewCount);
|
||||
this.is_live = view_count_renderer.isLive;
|
||||
}
|
||||
}
|
||||
export default UpdateViewershipAction;
|
||||
17
src/parser/classes/livechat/items/LiveChatBanner.js
Normal file
17
src/parser/classes/livechat/items/LiveChatBanner.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Parser from '../../../index';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatBanner extends YTNode {
|
||||
static type = 'LiveChatBanner';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.header = Parser.parse(data.header, 'livechat/items');
|
||||
this.contents = Parser.parse(data.contents, 'livechat/items');
|
||||
this.action_id = data.actionId;
|
||||
this.viewer_is_creator = data.viewerIsCreator;
|
||||
this.target_id = data.targetId;
|
||||
this.is_stackable = data.isStackable;
|
||||
this.background_type = data.backgroundType;
|
||||
}
|
||||
}
|
||||
export default LiveChatBanner;
|
||||
14
src/parser/classes/livechat/items/LiveChatBannerHeader.js
Normal file
14
src/parser/classes/livechat/items/LiveChatBannerHeader.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Parser from '../../../index';
|
||||
import Text from '../../misc/Text';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatBannerHeader extends YTNode {
|
||||
static type = 'LiveChatBannerHeader';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.text = new Text(data.text).toString();
|
||||
this.icon_type = data.icon.iconType;
|
||||
this.context_menu_button = Parser.parse(data.contextMenuButton);
|
||||
}
|
||||
}
|
||||
export default LiveChatBannerHeader;
|
||||
21
src/parser/classes/livechat/items/LiveChatBannerPoll.js
Normal file
21
src/parser/classes/livechat/items/LiveChatBannerPoll.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import Parser from '../../../index';
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatBannerPoll extends YTNode {
|
||||
static type = 'LiveChatBannerPoll';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.poll_question = new Text(data.pollQuestion);
|
||||
this.author_photo = Thumbnail.fromResponse(data.authorPhoto);
|
||||
this.choices = data.pollChoices.map((choice) => ({
|
||||
option_id: choice.pollOptionId,
|
||||
text: new Text(choice.text).toString()
|
||||
}));
|
||||
this.collapsed_state_entity_key = data.collapsedStateEntityKey;
|
||||
this.live_chat_poll_state_entity_key = data.liveChatPollStateEntityKey;
|
||||
this.context_menu_button = Parser.parse(data.contextMenuButton);
|
||||
}
|
||||
}
|
||||
export default LiveChatBannerPoll;
|
||||
23
src/parser/classes/livechat/items/LiveChatMembershipItem.js
Normal file
23
src/parser/classes/livechat/items/LiveChatMembershipItem.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import Parser from '../../../index';
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import NavigationEndpoint from '../../NavigationEndpoint';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatMembershipItem extends YTNode {
|
||||
static type = 'LiveChatMembershipItem';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000);
|
||||
this.header_subtext = new Text(data.headerSubtext);
|
||||
this.author = {
|
||||
id: data.authorExternalChannelId,
|
||||
name: new Text(data?.authorName),
|
||||
thumbnails: Thumbnail.fromResponse(data.authorPhoto),
|
||||
badges: Parser.parse(data.authorBadges)
|
||||
};
|
||||
this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint);
|
||||
}
|
||||
}
|
||||
export default LiveChatMembershipItem;
|
||||
30
src/parser/classes/livechat/items/LiveChatPaidMessage.js
Normal file
30
src/parser/classes/livechat/items/LiveChatPaidMessage.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import NavigationEndpoint from '../../NavigationEndpoint';
|
||||
import Parser from '../../../index';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatPaidMessage extends YTNode {
|
||||
static type = 'LiveChatPaidMessage';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.message = new Text(data.message);
|
||||
this.author = {
|
||||
id: data.authorExternalChannelId,
|
||||
name: new Text(data.authorName),
|
||||
thumbnails: Thumbnail.fromResponse(data.authorPhoto),
|
||||
badges: Parser.parse(data.authorBadges)
|
||||
};
|
||||
const badges = Parser.parse(data.authorBadges);
|
||||
this.author.badges = badges;
|
||||
this.author.is_moderator = badges?.some((badge) => badge.icon_type == 'MODERATOR') || null;
|
||||
this.author.is_verified = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED') || null;
|
||||
this.author.is_verified_artist = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED_ARTIST') || null;
|
||||
this.purchase_amount = new Text(data.purchaseAmountText).toString();
|
||||
this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint);
|
||||
this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000);
|
||||
this.timestamp_text = new Text(data.timestampText).toString();
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
export default LiveChatPaidMessage;
|
||||
24
src/parser/classes/livechat/items/LiveChatPaidSticker.js
Normal file
24
src/parser/classes/livechat/items/LiveChatPaidSticker.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import Parser from '../../../index';
|
||||
import NavigationEndpoint from '../../NavigationEndpoint';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import Text from '../../misc/Text';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatPaidSticker extends YTNode {
|
||||
static type = 'LiveChatPaidSticker';
|
||||
constructor(data) {
|
||||
super();
|
||||
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);
|
||||
}
|
||||
}
|
||||
export default LiveChatPaidSticker;
|
||||
11
src/parser/classes/livechat/items/LiveChatPlaceholderItem.js
Normal file
11
src/parser/classes/livechat/items/LiveChatPlaceholderItem.js
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatPlaceholderItem extends YTNode {
|
||||
static type = 'LiveChatPlaceholderItem';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000);
|
||||
}
|
||||
}
|
||||
export default LiveChatPlaceholderItem;
|
||||
27
src/parser/classes/livechat/items/LiveChatTextMessage.js
Normal file
27
src/parser/classes/livechat/items/LiveChatTextMessage.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import NavigationEndpoint from '../../NavigationEndpoint';
|
||||
import Parser from '../../../index';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatTextMessage extends YTNode {
|
||||
static type = 'LiveChatTextMessage';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.message = new Text(data.message);
|
||||
this.author = {
|
||||
id: data.authorExternalChannelId,
|
||||
name: new Text(data.authorName),
|
||||
thumbnails: Thumbnail.fromResponse(data.authorPhoto)
|
||||
};
|
||||
const badges = Parser.parse(data.authorBadges);
|
||||
this.author.badges = badges;
|
||||
this.author.is_moderator = badges?.some((badge) => badge.icon_type == 'MODERATOR') || null;
|
||||
this.author.is_verified = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED') || null;
|
||||
this.author.is_verified_artist = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED_ARTIST') || null;
|
||||
this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint);
|
||||
this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000);
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
export default LiveChatTextMessage;
|
||||
@@ -0,0 +1,29 @@
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import NavigationEndpoint from '../../NavigationEndpoint';
|
||||
import Parser from '../../../index';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatTickerPaidMessageItem extends YTNode {
|
||||
static type = 'LiveChatTickerPaidMessageItem';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.author = {
|
||||
id: data.authorExternalChannelId,
|
||||
thumbnails: Thumbnail.fromResponse(data.authorPhoto),
|
||||
badges: Parser.parse(data.authorBadges)
|
||||
};
|
||||
const badges = Parser.parse(data.authorBadges);
|
||||
this.author.badges = badges;
|
||||
this.author.is_moderator = badges?.some((badge) => badge.icon_type == 'MODERATOR') || null;
|
||||
this.author.is_verified = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED') || null;
|
||||
this.author.is_verified_artist = badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED_ARTIST') || null;
|
||||
this.amount = new Text(data.amount);
|
||||
this.duration_sec = data.durationSec;
|
||||
this.full_duration_sec = data.fullDurationSec;
|
||||
this.show_item = Parser.parse(data.showItemEndpoint.showLiveChatItemEndpoint.renderer, 'livechat/items');
|
||||
this.show_item_endpoint = new NavigationEndpoint(data.showItemEndpoint);
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
export default LiveChatTickerPaidMessageItem;
|
||||
@@ -0,0 +1,21 @@
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class LiveChatTickerSponsorItem extends YTNode {
|
||||
static type = 'LiveChatTickerSponsorItem';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.detail_text = new Text(data.detailText).toString();
|
||||
this.author = {
|
||||
id: data.authorExternalChannelId,
|
||||
name: new Text(data?.authorName),
|
||||
thumbnails: Thumbnail.fromResponse(data.sponsorPhoto)
|
||||
};
|
||||
this.duration_sec = data.durationSec;
|
||||
// TODO: finish this
|
||||
// Console.log(data)
|
||||
}
|
||||
}
|
||||
export default LiveChatTickerSponsorItem;
|
||||
@@ -0,0 +1,14 @@
|
||||
import LiveChatTextMessage from './LiveChatTextMessage';
|
||||
import Parser from '../../../index';
|
||||
|
||||
class LiveChatViewerEngagementMessage extends LiveChatTextMessage {
|
||||
static type = 'LiveChatViewerEngagementMessage';
|
||||
constructor(data) {
|
||||
super(data);
|
||||
delete this.author;
|
||||
delete this.menu_endpoint;
|
||||
this.icon_type = data.icon.iconType;
|
||||
this.action_button = Parser.parse(data.actionButton);
|
||||
}
|
||||
}
|
||||
export default LiveChatViewerEngagementMessage;
|
||||
17
src/parser/classes/livechat/items/PollHeader.js
Normal file
17
src/parser/classes/livechat/items/PollHeader.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Text from '../../misc/Text';
|
||||
import Thumbnail from '../../misc/Thumbnail';
|
||||
import Parser from '../../../index';
|
||||
|
||||
import { YTNode } from '../../../helpers';
|
||||
class PollHeader extends YTNode {
|
||||
static type = 'PollHeader';
|
||||
constructor(data) {
|
||||
super();
|
||||
this.poll_question = new Text(data.pollQuestion);
|
||||
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
|
||||
this.metadata = new Text(data.metadataText);
|
||||
this.live_chat_poll_type = data.liveChatPollType;
|
||||
this.context_menu_button = Parser.parse(data.contextMenuButton);
|
||||
}
|
||||
}
|
||||
export default PollHeader;
|
||||
Reference in New Issue
Block a user