Skip to content

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
Contributor

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
@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ bot-api affected functionality: bot-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants