Skip to content

Supports Bot API 9.5 and adds related tests and examples#2567

Open
DanielHallx wants to merge 2 commits intoeternnoir:masterfrom
DanielHallx:master
Open

Supports Bot API 9.5 and adds related tests and examples#2567
DanielHallx wants to merge 2 commits intoeternnoir:masterfrom
DanielHallx:master

Conversation

@DanielHallx
Copy link

Description

Adapt Bot API 9.5 in the library and add repository-style validation/examples for the new features.

Library changes included:

  • Added date_time support to MessageEntity, including unix_time and date_time_format
  • Added sender_tag to Message
  • Added tag to ChatMemberMember and ChatMemberRestricted
  • Added can_edit_tag to ChatMemberRestricted and ChatPermissions
  • Added can_manage_tags to ChatMemberAdministrator and ChatAdministratorRights
  • Added can_manage_tags support to promote_chat_member in sync and async implementations
  • Added set_chat_member_tag in sync and async implementations, plus low-level API helpers
  • Updated send_message_draft docs to match Bot API 9.5 behavior

Additional follow-up changes:

  • Added offline coverage for new fields and method forwarding
  • Added optional live integration coverage for:
    • sending a message with a date_time entity
    • set_chat_member_tag with restore of the original tag
  • Added sync and async examples for:
    • date_time
    • set_chat_member_tag

Describe your tests

How did you test your change?

  • Ran offline tests:
    • .venv/bin/python -m pytest tests/test_types.py tests/test_telebot.py -q
  • Ran targeted live smoke tests with TOKEN, CHAT_ID, GROUP_ID, and TEST_MEMBER_ID configured:
    • .venv/bin/python -m pytest tests/test_telebot.py -q -k 'date_time_entity or set_chat_member_tag'
  • Ran syntax verification:
    • .venv/bin/python -m compileall tests/test_telebot.py examples/date_time_example.py examples/set_chat_member_tag_example.py examples/asynchronous_telebot/date_time_example.py examples/asynchronous_telebot/set_chat_member_tag_example.py

Python version:

  • 3.13.6

OS:

  • macOS 15.6.1

Checklist:

  • I added/edited example on new feature/change (if exists)
  • My changes won't break backward compatibility
  • I made changes both for sync and async

Introduce support for member tags and related permissions across the library. Added API methods set_chat_member_tag to apihelper and asyncio_helper and corresponding TeleBot/AsyncTeleBot wrappers. Extend promote_chat_member to accept can_manage_tags and forward it through helper calls. Update types to handle sender_tag, MessageEntity "date_time" (unix_time and date_time_format), ChatMember (member/tag/restricted tag and can_edit_tag), ChatPermissions.can_edit_tag, and ChatAdministratorRights.can_manage_tags. Add unit tests for new behaviour and async variants.
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.

1 participant