Make provider_token Argument Optional#4689
Merged
Bibo-Joshi merged 2 commits intomasterfrom Feb 26, 2025
Merged
Conversation
harshil21
approved these changes
Feb 25, 2025
Member
harshil21
left a comment
There was a problem hiding this comment.
damn that's wild that it went unnoticed for so long
Contributor
There was a problem hiding this comment.
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,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The forgotton follow-up for #4275
Carries out deprecations from API 7.4. This is in line with our stability policy.