Skip to content

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

Merged
merged 16 commits into from
Apr 28, 2025
Merged

Api 9.0 profile photos #4766

merged 16 commits into from
Apr 28, 2025

Conversation

Bibo-Joshi
Copy link
Member

Check-list for PRs

  • Added .. 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)
  • Created new or adapted existing unit tests
  • Documented code changes according to the CSI standard <https://standards.mousepawmedia.com/en/stable/csi.html>__
  • Added new classes & modules to the docs and all suitable __all__ s
  • Checked the Stability Policy <https://docs.python-telegram-bot.org/stability_policy.html>_ in case of deprecations or changes to documented behavior

If 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:

    • Added self._id_attrs and corresponding documentation
  • Added new shortcuts:

    • In :class:~telegram.Chat & :class:~telegram.User for all methods that accept chat/user_id
  • If relevant:

    • Added new constants at :mod:telegram.constants and shortcuts to them as class variables
    • Link new and existing constants in docstrings instead of hard-coded numbers and strings
    • Added new filters for new message (sub)types
    • Added the new method(s) to _extbot.py
    • Added or updated bot_methods.rst

@Bibo-Joshi Bibo-Joshi added the ⚙️ bot-api affected functionality: bot-api label Apr 24, 2025
@Bibo-Joshi Bibo-Joshi requested a review from Copilot April 24, 2025 19:28
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.

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

Bibo-Joshi and others added 4 commits April 24, 2025 21:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Bibo-Joshi Bibo-Joshi mentioned this pull request Apr 24, 2025
35 tasks
@Bibo-Joshi Bibo-Joshi marked this pull request as ready for review April 24, 2025 19:56
Copy link
Member

@aelkheir aelkheir left a 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..

Bibo-Joshi and others added 2 commits April 25, 2025 16:23
Co-authored-by: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com>
Co-authored-by: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com>
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.

just a few minor kinks

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.

LGTM

Copy link
Member

@aelkheir aelkheir left a comment

Choose a reason for hiding this comment

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

Good to go!

@Bibo-Joshi Bibo-Joshi merged commit 380282e into api_9.0 Apr 28, 2025
24 of 26 checks passed
@Bibo-Joshi Bibo-Joshi deleted the api_9.0-profile-photos branch April 28, 2025 16:29
@github-actions github-actions bot locked and limited conversation to collaborators May 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants