Skip to content

Commit

Permalink
Update tweet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ankh2054 authored Jan 11, 2025
1 parent a1c6ec2 commit 48fb557
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions twikit/tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ def __init__(self, client: Client, data: dict, user: User = None) -> None:
# Get bookmark count from public_metrics if available, otherwise from legacy
public_metrics = data.get('public_metrics', {})
self.bookmark_count: int | None = (
public_metrics.get('bookmark_count') or
legacy.get('bookmark_count')
public_metrics.get('bookmark_count')
if public_metrics.get('bookmark_count') is not None
else legacy.get('bookmark_count')
)

if data.get('quoted_status_result'):
Expand Down

0 comments on commit 48fb557

Please sign in to comment.