diff --git a/src/parser/classes/livechat/items/LiveChatBannerChatSummary.ts b/src/parser/classes/livechat/items/LiveChatBannerChatSummary.ts new file mode 100644 index 000000000..351809ddc --- /dev/null +++ b/src/parser/classes/livechat/items/LiveChatBannerChatSummary.ts @@ -0,0 +1,23 @@ +import { YTNode } from '../../../helpers.js'; +import { Parser, type RawNode } from '../../../index.js'; +import Text from '../../misc/Text.js'; +import ToggleButtonView from '../../ToggleButtonView.js'; + +export default class LiveChatBannerChatSummary extends YTNode { + static type = 'LiveChatBannerChatSummary'; + + id: string; + chat_summary: Text; + icon_type: string; + like_feedback_button: ToggleButtonView | null; + dislike_feedback_button: ToggleButtonView | null; + + constructor(data: RawNode) { + super(); + this.id = data.liveChatSummaryId; + this.chat_summary = new Text(data.chatSummary); + this.icon_type = data.icon.iconType; + this.like_feedback_button = Parser.parseItem(data.likeFeedbackButton, ToggleButtonView); + this.dislike_feedback_button = Parser.parseItem(data.dislikeFeedbackButton, ToggleButtonView); + } +} diff --git a/src/parser/classes/misc/TextRun.ts b/src/parser/classes/misc/TextRun.ts index abbd68027..c64208af8 100644 --- a/src/parser/classes/misc/TextRun.ts +++ b/src/parser/classes/misc/TextRun.ts @@ -8,6 +8,7 @@ export default class TextRun implements Run { bold: boolean; italics: boolean; strikethrough: boolean; + deemphasize: boolean; attachment; constructor(data: RawNode) { @@ -15,6 +16,7 @@ export default class TextRun implements Run { this.bold = Boolean(data.bold); this.italics = Boolean(data.italics); this.strikethrough = Boolean(data.strikethrough); + this.deemphasize = Boolean(data.deemphasize); if (Reflect.has(data, 'navigationEndpoint')) { this.endpoint = new NavigationEndpoint(data.navigationEndpoint); @@ -33,6 +35,7 @@ export default class TextRun implements Run { if (this.bold) tags.push('b'); if (this.italics) tags.push('i'); if (this.strikethrough) tags.push('s'); + if (this.deemphasize) tags.push('small'); const escaped_text = escape(this.text); const styled_text = tags.map((tag) => `<${tag}>`).join('') + escaped_text + tags.map((tag) => ``).join(''); diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index 95f526217..08636da2a 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -182,6 +182,7 @@ export { default as AddLiveChatTickerItemAction } from './classes/livechat/AddLi export { default as DimChatItemAction } from './classes/livechat/DimChatItemAction.js'; export { default as LiveChatAutoModMessage } from './classes/livechat/items/LiveChatAutoModMessage.js'; export { default as LiveChatBanner } from './classes/livechat/items/LiveChatBanner.js'; +export { default as LiveChatBannerChatSummary } from './classes/livechat/items/LiveChatBannerChatSummary.js'; export { default as LiveChatBannerHeader } from './classes/livechat/items/LiveChatBannerHeader.js'; export { default as LiveChatBannerPoll } from './classes/livechat/items/LiveChatBannerPoll.js'; export { default as LiveChatBannerRedirect } from './classes/livechat/items/LiveChatBannerRedirect.js';