Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements API 9.0 support for business account profile photos by adding new input types, constants, and corresponding bot methods as well as associated tests. Key changes include:
- New InputProfilePhoto classes (static and animated) and corresponding type enums.
- Addition of new bot methods and aliases in _bot.py and _extbot.py.
- New and updated tests to cover profile photo functionality.
Reviewed Changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_business_methods.py | Added tests for setting and removing business account profile photos. |
| tests/request/test_requestparameter.py | Added tests for profile photo input conversion in request parameters. |
| tests/_files/test_inputprofilephoto.py | Added tests for InputProfilePhoto behavior. |
| telegram/request/_requestparameter.py | Updated input handling to support InputProfilePhoto instances. |
| telegram/ext/_extbot.py | Added business account profile photo methods and their aliases. |
| telegram/constants.py | Introduced InputProfilePhotoType enum. |
| telegram/_files/inputprofilephoto.py | New file for InputProfilePhoto, InputProfilePhotoStatic, and InputProfilePhotoAnimated. |
| telegram/_bot.py | Added bot methods for profile photo operations and updated docstrings. |
| telegram/init.py | Updated public API exports. |
| changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml | Recorded the new changes in the changelog. |
Files not reviewed (5)
- docs/source/inclusions/bot_methods.rst: Language not supported
- docs/source/telegram.at-tree.rst: Language not supported
- docs/source/telegram.inputprofilephoto.rst: Language not supported
- docs/source/telegram.inputprofilephotoanimated.rst: Language not supported
- docs/source/telegram.inputprofilephotostatic.rst: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
35 tasks
aelkheir
reviewed
Apr 24, 2025
Member
aelkheir
left a comment
There was a problem hiding this comment.
looking good.. didn't review everything but these places caught my eye..
Co-authored-by: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com>
Co-authored-by: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com>
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.
Check-list for PRs
.. versionadded:: NEXT.VERSION,.. versionchanged:: NEXT.VERSION,.. deprecated:: NEXT.VERSIONor.. versionremoved:: NEXT.VERSIONto the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)CSI standard <https://standards.mousepawmedia.com/en/stable/csi.html>____all__sStability Policy <https://docs.python-telegram-bot.org/stability_policy.html>_ in case of deprecations or changes to documented behaviorIf the PR contains API changes (otherwise, you can ignore this passage)
Checked the Bot API specific sections of the
Stability Policy <https://docs.python-telegram-bot.org/stability_policy.html>_Created a PR to remove functionality deprecated in the previous Bot API release (
see here <https://docs.python-telegram-bot.org/en/stable/stability_policy.html#case-2>_)New classes:
Addedself._id_attrsand corresponding documentationAdded new shortcuts:
In :class:~telegram.Chat& :class:~telegram.Userfor all methods that acceptchat/user_idIf relevant:
telegram.constantsand shortcuts to them as class variablesAdded new filters for new message (sub)types_extbot.pybot_methods.rst