Skip to content

Add compatibility wrappers for issue #50 missing methods#80

Open
notedavidrinaldi wants to merge 2 commits into
hydrogram:devfrom
notedavidrinaldi:compat/issue-50-aliases
Open

Add compatibility wrappers for issue #50 missing methods#80
notedavidrinaldi wants to merge 2 commits into
hydrogram:devfrom
notedavidrinaldi:compat/issue-50-aliases

Conversation

@notedavidrinaldi

@notedavidrinaldi notedavidrinaldi commented Jul 9, 2026

Copy link
Copy Markdown

Description

Implemented compatibility wrappers for several Bot API methods listed in issue #50 by mapping them to existing Hydrogram methods where behavior already existed.

This change is a compatibility layer to reduce breaking integration issues for code expecting Bot API method names that were missing from Client.

Implemented methods include:

  • close
  • forward_message
  • copy_messages
  • delete_message
  • get_chat_member_count
  • get_chat_administrators
  • set_chat_administrator_custom_title
  • close_general_forum_topic
  • edit_general_forum_topic
  • reopen_general_forum_topic
  • hide_general_forum_topic
  • unhide_general_forum_topic
  • unpin_all_forum_topic_messages
  • unpin_all_general_forum_topic_messages
  • set_message_reaction
  • set_my_commands
  • get_my_commands
  • delete_my_commands
  • set_user_emoji_status

Also updated method mixins (__init__), added a small AST-based presence test, and added a changelog fragment.

Closes #50

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test A

  • python3 -m py_compile on all new/modified method files and test file.
  • Command:
python3 -m py_compile \
  hydrogram/methods/chats/__init__.py hydrogram/methods/messages/__init__.py hydrogram/methods/users/__init__.py hydrogram/methods/bots/__init__.py hydrogram/methods/utilities/__init__.py \
  hydrogram/methods/chats/close_general_forum_topic.py hydrogram/methods/chats/reopen_general_forum_topic.py hydrogram/methods/chats/hide_general_forum_topic.py hydrogram/methods/chats/unhide_general_forum_topic.py \
  hydrogram/methods/chats/edit_general_forum_topic.py hydrogram/methods/chats/get_chat_administrators.py hydrogram/methods/chats/unpin_all_forum_topic_messages.py hydrogram/methods/chats/unpin_all_general_forum_topic_messages.py \
  hydrogram/methods/messages/set_message_reaction.py tests/test_issue_50_missing_methods.py

Test B

  • pytest -q tests/test_issue_50_missing_methods.py
  • Result: 1 passed in 0.09s

Test Configuration

Operating System: macOS (local)
Python Version: 3.10

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing methods and objects/types from the bot API

2 participants