diff --git a/src/parser/classes/livechat/items/LiveChatPaidMessage.ts b/src/parser/classes/livechat/items/LiveChatPaidMessage.ts index b2cb0426..14cc4b08 100644 --- a/src/parser/classes/livechat/items/LiveChatPaidMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatPaidMessage.ts @@ -2,6 +2,7 @@ import Text from '../../misc/Text'; import Thumbnail from '../../misc/Thumbnail'; import NavigationEndpoint from '../../NavigationEndpoint'; import MetadataBadge from '../../MetadataBadge'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; import Parser from '../../../index'; import { YTNode } from '../../../helpers'; @@ -14,7 +15,7 @@ class LiveChatPaidMessage extends YTNode { id: string; name: Text; thumbnails: Thumbnail[]; - badges: MetadataBadge[]; + badges: LiveChatAuthorBadge[] | MetadataBadge[]; is_moderator: boolean | null; is_verified: boolean | null; is_verified_artist: boolean | null; @@ -38,13 +39,13 @@ class LiveChatPaidMessage extends YTNode { id: data.authorExternalChannelId, name: new Text(data.authorName), thumbnails: Thumbnail.fromResponse(data.authorPhoto), - badges: Parser.parseArray(data.authorBadges, MetadataBadge), + badges: Parser.parseArray(data.authorBadges, [ MetadataBadge, LiveChatAuthorBadge ]), is_moderator: null, is_verified: null, is_verified_artist: null }; - const badges = Parser.parseArray(data.authorBadges, MetadataBadge); + const badges = Parser.parseArray(data.authorBadges, [ MetadataBadge, LiveChatAuthorBadge ]); this.author.badges = badges; this.author.is_moderator = badges?.some((badge: any) => badge.icon_type == 'MODERATOR') || null; diff --git a/src/parser/classes/livechat/items/LiveChatTextMessage.ts b/src/parser/classes/livechat/items/LiveChatTextMessage.ts index 9524e90f..c22dc0c5 100644 --- a/src/parser/classes/livechat/items/LiveChatTextMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatTextMessage.ts @@ -2,6 +2,7 @@ import Text from '../../misc/Text'; import Thumbnail from '../../misc/Thumbnail'; import NavigationEndpoint from '../../NavigationEndpoint'; import MetadataBadge from '../../MetadataBadge'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; import Parser from '../../../index'; import { YTNode } from '../../../helpers'; @@ -14,7 +15,7 @@ class LiveChatTextMessage extends YTNode { id: string; name: Text; thumbnails: Thumbnail[]; - badges: MetadataBadge[]; + badges: LiveChatAuthorBadge[] | MetadataBadge[]; is_moderator: boolean | null; is_verified: boolean | null; is_verified_artist: boolean | null; @@ -32,13 +33,13 @@ class LiveChatTextMessage extends YTNode { id: data.authorExternalChannelId, name: new Text(data.authorName), thumbnails: Thumbnail.fromResponse(data.authorPhoto), - badges: [] as MetadataBadge[], + badges: [] as LiveChatAuthorBadge[] | [] as MetadataBadge[], is_moderator: null, is_verified: null, is_verified_artist: null }; - const badges = Parser.parseArray(data.authorBadges, MetadataBadge); + const badges = Parser.parseArray(data.authorBadges, [ MetadataBadge, LiveChatAuthorBadge ]); this.author.badges = badges; this.author.is_moderator = badges ? badges.some((badge) => badge.icon_type == 'MODERATOR') : null; diff --git a/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts b/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts index 54cdd349..0a0133d1 100644 --- a/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts +++ b/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts @@ -2,6 +2,7 @@ import Text from '../../misc/Text'; import Thumbnail from '../../misc/Thumbnail'; import NavigationEndpoint from '../../NavigationEndpoint'; import MetadataBadge from '../../MetadataBadge'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; import Parser from '../../../index'; import { YTNode } from '../../../helpers'; @@ -12,7 +13,7 @@ class LiveChatTickerPaidMessageItem extends YTNode { author: { id: string; thumbnails: Thumbnail[]; - badges: MetadataBadge[]; + badges: LiveChatAuthorBadge[] | MetadataBadge[]; is_moderator: boolean | null; is_verified: boolean | null; is_verified_artist: boolean | null; @@ -31,13 +32,13 @@ class LiveChatTickerPaidMessageItem extends YTNode { this.author = { id: data.authorExternalChannelId, thumbnails: Thumbnail.fromResponse(data.authorPhoto), - badges: Parser.parseArray(data.authorBadges, MetadataBadge), + badges: Parser.parseArray(data.authorBadges, [ MetadataBadge, LiveChatAuthorBadge ]), is_moderator: null, is_verified: null, is_verified_artist: null }; - const badges = Parser.parseArray(data.authorBadges, MetadataBadge); + const badges = Parser.parseArray(data.authorBadges, [ MetadataBadge, LiveChatAuthorBadge ]); this.author.badges = badges; this.author.is_moderator = badges?.some((badge) => badge.icon_type == 'MODERATOR') || null;