Supports Bot API 9.5 and adds related tests and examples#2567
Open
DanielHallx wants to merge 2 commits intoeternnoir:masterfrom
Open
Supports Bot API 9.5 and adds related tests and examples#2567DanielHallx wants to merge 2 commits intoeternnoir:masterfrom
DanielHallx wants to merge 2 commits intoeternnoir:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adapt Bot API 9.5 in the library and add repository-style validation/examples for the new features.
Library changes included:
date_timesupport toMessageEntity, includingunix_timeanddate_time_formatsender_tagtoMessagetagtoChatMemberMemberandChatMemberRestrictedcan_edit_tagtoChatMemberRestrictedandChatPermissionscan_manage_tagstoChatMemberAdministratorandChatAdministratorRightscan_manage_tagssupport topromote_chat_memberin sync and async implementationsset_chat_member_tagin sync and async implementations, plus low-level API helperssend_message_draftdocs to match Bot API 9.5 behaviorAdditional follow-up changes:
date_timeentityset_chat_member_tagwith restore of the original tagdate_timeset_chat_member_tagDescribe your tests
How did you test your change?
.venv/bin/python -m pytest tests/test_types.py tests/test_telebot.py -qTOKEN,CHAT_ID,GROUP_ID, andTEST_MEMBER_IDconfigured:.venv/bin/python -m pytest tests/test_telebot.py -q -k 'date_time_entity or set_chat_member_tag'.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.pyPython version:
OS:
Checklist: