harshil21 · GitHub

@harshil21

@harshil21

Pull request overview

Adds Bot API 10.0 “Chat Management” support to the library by introducing new reaction-deletion endpoints, extending admin retrieval to optionally include bots, and adding the new can_react_to_messages permission to relevant objects, along with corresponding test and documentation updates.

Changes:

  • Add delete_message_reaction / delete_all_message_reactions to Bot/ExtBot and new shortcut methods on Chat, Message, and User.
  • Extend get_chat_administrators (and Chat.get_administrators) with the return_bots parameter and adapt tests.
  • Add can_react_to_messages to ChatPermissions and ChatMemberRestricted, updating serialization/equality tests and docs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_user.py Adds tests for new User reaction deletion shortcuts.
tests/test_message.py Adds tests for new Message.delete_reaction shortcut.
tests/test_chatpermissions.py Updates ChatPermissions tests for can_react_to_messages.
tests/test_chatmember.py Updates ChatMemberRestricted tests for can_react_to_messages.
tests/test_chat.py Adds tests for new Chat reaction deletion shortcuts.
tests/test_bot.py Adds offline request-shape tests for new bot methods; updates get_chat_administrators test to use return_bots.
src/telegram/ext/_extbot.py Plumbs return_bots and adds ExtBot wrappers + camelCase aliases for new endpoints.
src/telegram/_user.py Fixes replace_token return docs; adds User reaction deletion shortcuts.
src/telegram/_message.py Adds Message.delete_reaction shortcut.
src/telegram/_chatpermissions.py Adds can_react_to_messages to model/equality and docs.
src/telegram/_chatmember.py Adds can_react_to_messages to ChatMemberRestricted model/docs (with optional signature).
src/telegram/_chat.py Adds return_bots to Chat.get_administrators; adds reaction deletion shortcuts.
src/telegram/_bot.py Adds return_bots support for get_chat_administrators; adds new reaction deletion endpoints + aliases.
docs/source/inclusions/bot_methods.rst Adds the new bot methods to the quick overview table.
changes/unreleased/5229.87PBN4GFkuAaDhhgFwCYkY.toml Updates the unreleased changelog entry for Bot API 10.0 support.
Comments suppressed due to low confidence (1)

src/telegram/_bot.py:5154

  • The return description still says that the result excludes other bots, but the new return_bots parameter allows including them. Please update the Returns: text to describe both cases (default omits other bots; return_bots=True includes them).
        Returns:
            tuple[:class:`telegram.ChatMember`]: On success, returns a tuple of ``ChatMember``
            objects that contains information about all chat administrators except
            other bots. If the chat is a group or a supergroup and no administrators were
            appointed, only the creator will be returned.

@harshil21

aelkheir

@harshil21

Open

@harshil21

@harshil21

@harshil21

aelkheir

@harshil21

aelkheir

@harshil21

@harshil21

harshil21 deleted the api-10.0-chat-management branch

May 20, 2026 19:37

Closed

37 tasks

Read the original on github.com ↗