Skip to content

Make provider_token Argument Optional #4689

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 2 commits into from
Feb 26, 2025
Merged

Make provider_token Argument Optional #4689

merged 2 commits into from
Feb 26, 2025

Conversation

Bibo-Joshi
Copy link
Member

The forgotton follow-up for #4275

Carries out deprecations from API 7.4. This is in line with our stability policy.

@Bibo-Joshi Bibo-Joshi added ⚙️ bot-api affected functionality: bot-api 🛠 breaking change type: breaking labels Feb 22, 2025
Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

damn that's wild that it went unnoticed for so long

@harshil21 harshil21 requested a review from Copilot February 26, 2025 18:18
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.

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

Comments suppressed due to low confidence (6)

examples/paymentbot.py:66

  • [nitpick] The example now uses the 'provider_token' as a keyword argument with a default value. Please consider adding an inline comment in the example to clarify that the parameter is optional and should be passed by keyword.
provider_token=PAYMENT_PROVIDER_TOKEN,

tests/test_official/exceptions.py:209

  • The removal of 'provider_token' from the backwards compatibility kwargs appears intentional. Ensure that additional test cases verify the new optional behavior of 'provider_token' so that regressions are caught.
BACKWARDS_COMPAT_KWARGS: dict[str, set[str]] = {}

telegram/_inline/inputinvoicemessagecontent.py:38

  • The equality comparison now excludes 'provider_token' per the updated docs. Please confirm that all consumers relying on equality for InputInvoiceMessageContent are updated and that corresponding tests reflect this change.
:attr:`currency` and :attr:`prices` are equal.

telegram/_bot.py:5182

  • The function signature now defaults 'provider_token' to None to reflect Bot API 7.4 changes. Verify that any downstream logic correctly handles a None value for this parameter.
provider_token: Optional[str] = None,

telegram/_chat.py:1581

  • The update makes 'provider_token' optional in the send_invoice method. Ensure that the associated docstrings and any logic expecting a non-empty token are revised accordingly.
provider_token: Optional[str] = None,

telegram/ext/_extbot.py:1200

  • The updated function signature now sets the provider_token default to None. Please double-check that no deprecated annotations or legacy logic still assume a required provider_token.
provider_token: Optional[str] = None,

@Bibo-Joshi Bibo-Joshi merged commit 5d73132 into master Feb 26, 2025
25 of 26 checks passed
@Bibo-Joshi Bibo-Joshi deleted the 7.4-deprecations branch February 26, 2025 19:58
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 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 🛠 breaking change type: breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants