-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Api 9.0 profile photos #4766
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
Api 9.0 profile photos #4766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few minor kinks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go!
Check-list for PRs
.. versionadded:: NEXT.VERSION
,.. versionchanged:: NEXT.VERSION
,.. deprecated:: NEXT.VERSION
or.. versionremoved:: NEXT.VERSION
to 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_attrs
and corresponding documentationAdded new shortcuts:
In :class:~telegram.Chat
& :class:~telegram.User
for all methods that acceptchat/user_id
If relevant:
telegram.constants
and shortcuts to them as class variablesAdded new filters for new message (sub)types_extbot.py
bot_methods.rst