Skip to content

Commit 8aeebfe

Browse files
Fix last resale price parsing in Gift
1 parent fe3e62f commit 8aeebfe

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • pyrogram/types/messages_and_media

pyrogram/types/messages_and_media/gift.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,10 @@ async def _parse_action(
432432
parsed_gift.transfer_price = action.transfer_stars
433433

434434
if action.resale_amount:
435-
for currency in action.resale_amount:
436-
if isinstance(currency, raw.types.StarsAmount):
437-
parsed_gift.last_resale_star_count = currency.amount
438-
elif isinstance(currency, raw.types.StarsTonAmount):
439-
parsed_gift.last_resale_ton_count = currency.amount
435+
if isinstance(action.resale_amount, raw.types.StarsAmount):
436+
parsed_gift.last_resale_star_count = action.resale_amount.amount
437+
elif isinstance(action.resale_amount, raw.types.StarsTonAmount):
438+
parsed_gift.last_resale_ton_count = action.resale_amount.amount
440439

441440
parsed_gift.upgrade_message_id = message.id
442441

0 commit comments

Comments
 (0)