Skip to content

Commit

Permalink
fix(yt): handle liveChatPlaceholderItemRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Apr 24, 2024
1 parent 9a89826 commit 2a3404a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/youtube/types/get_live_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ pub enum Action {
item: ChatItem,
client_id: Option<String>
},
#[serde(rename = "replaceChatItemAction")]
#[serde(rename_all = "camelCase")]
ReplaceChatItem {
target_item_id: String,
replacement_item: ChatItem
},
#[serde(rename = "removeChatItemAction")]
#[serde(rename_all = "camelCase")]
RemoveChatItem {
Expand Down Expand Up @@ -271,6 +277,13 @@ pub enum ChatItem {
#[serde(flatten)]
data: simd_json::OwnedValue
},
#[serde(rename = "liveChatPlaceholderItemRenderer")]
#[serde(rename_all = "camelCase")]
Placeholder {
id: String,
#[serde(deserialize_with = "deserialize_datetime_utc_from_microseconds")]
timestamp_usec: DateTime<Utc>
},
#[serde(rename = "liveChatViewerEngagementMessageRenderer")]
ViewerEngagement { id: String }
}
Expand All @@ -284,6 +297,7 @@ impl ChatItem {
ChatItem::TextMessage { message_renderer_base, .. } => &message_renderer_base.id,
ChatItem::MembershipGift { id, .. } => id,
ChatItem::MembershipGiftRedemption { id, .. } => id,
ChatItem::Placeholder { id, .. } => id,
ChatItem::ViewerEngagement { id } => id
}
}
Expand Down

0 comments on commit 2a3404a

Please sign in to comment.