8000 API 9.1 Gifts by harshil21 · Pull Request #4849 · python-telegram-bot/python-telegram-bot · GitHub
[go: up one dir, main page]

Skip to content

API 9.1 Gifts #4849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 4, 2025
Merged

API 9.1 Gifts #4849

merged 3 commits into from
Jul 4, 2025

Conversation

harshil21
Copy link
Member

Part of #4845

@harshil21 harshil21 added the ⚙️ bot-api affected functionality: bot-api label Jul 3, 2025
@harshil21 harshil21 requested a review from Copilot July 3, 2025 23:57
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for a resale origin on gifts and introduces a new next_transfer_date field across gift-related models.

  • Extend UniqueGiftInfoOrigin with RESALE and add corresponding fields (last_resale_star_count, next_transfer_date)
  • Update UniqueGiftInfo, OwnedGiftUnique, and related JSON (de)serialization to handle the new fields
  • Enhance tests to cover the new fields and enum conversion

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_uniquegift.py Added assertions for last_resale_star_count and next_transfer_date, plus an enum type test
tests/test_ownedgift.py Added next_transfer_date assertions and removed unused import
src/telegram/constants.py Introduced RESALE in UniqueGiftInfoOrigin
src/telegram/_uniquegift.py Added last_resale_star_count & next_transfer_date handling
src/telegram/_ownedgift.py Added next_transfer_date handling for OwnedGiftUnique
Comments suppressed due to low confidence (2)

src/telegram/constants.py:3215

  • [nitpick] Consider adding a period at the end of this docstring description for consistency with other enum entries.
    """:obj:`str` gift bought from other users

tests/test_uniquegift.py:390

  • Add a dedicated test case for the RESALE origin to verify last_resale_star_count is parsed and serialized correctly when origin is RESALE.
        last_resale_star_count=UniqueGiftInfoTestBase.last_resale_star_count,

Copy link
Member
@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks very much for the PR! just one comment

@Bibo-Joshi
Copy link
Member

merge at will :) (poor [lucky?] Will …)

@harshil21 harshil21 merged commit faa553d into api-9.1 Jul 4, 2025
26 of 29 checks passed
@harshil21 harshil21 deleted the api-9.1-gifts branch July 4, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ bot-api affected functionality: bot-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0