feat: add YouTube channel ID to chat message data model

This commit is contained in:
Yusuf İpek
2025-10-06 00:02:02 +03:00
parent 7d502c26ea
commit c131913b8a
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -306,10 +306,14 @@ function normalizeAction(action: any): ChatMessage | null {
}
}
// Extract channel ID from author object (item.author.id contains the YouTube channel ID)
const authorChannelId = item.author?.id;
return {
id: String(item.id ?? item.timestamp_usec ?? Date.now()),
author: String(item.author?.name ?? 'Unknown'),
authorPhoto: item.author?.thumbnails?.[0]?.url,
authorChannelId: authorChannelId ? String(authorChannelId) : undefined,
text: resolveMessageText(item),
publishedAt: resolveTimestamp(item.timestamp ?? item.timestamp_usec),
badges: badges.length > 0 ? badges : undefined,
+1
View File
@@ -14,6 +14,7 @@ export type ChatMessage = {
id: string;
author: string;
authorPhoto?: string;
authorChannelId?: string;
text: string;
publishedAt: string;
badges?: Badge[];