Skip to content
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

Bot API Huge Update - 7.0, introducing reactions, replies and some other changes #2106

Merged
merged 47 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
430e327
Start of bot API Update - 7.0
coder2020official Dec 29, 2023
134f45b
Added the classes ReactionTypeEmoji and ReactionTypeCustomEmoji repre…
coder2020official Dec 29, 2023
974395e
New handler: message_reaction_handler(untested)
coder2020official Dec 29, 2023
8fee136
Fix tests for the new handler
coder2020official Dec 29, 2023
97e0d4e
Fix tests #2
coder2020official Dec 29, 2023
2fb2e30
Fix minor issue for tests #3
coder2020official Dec 29, 2023
854c685
Added updates about reaction changes on a message with anonymous rea…
coder2020official Dec 29, 2023
96b4ced
Fix tests for the new handler
coder2020official Dec 29, 2023
b6a0d6c
Added the method setMessageReaction that allows bots to react to mess…
coder2020official Dec 29, 2023
7576458
Added the field available_reactions to the class Chat.
coder2020official Dec 29, 2023
ad816f2
Added the class ExternalReplyInfo and the field external_reply of typ…
coder2020official Dec 29, 2023
5e01891
Added TextQuote and fixed extrernal_reply (forgot in previous commit)…
coder2020official Dec 29, 2023
2604655
ReplyParameters support for sync, including backward compatibility
coder2020official Dec 29, 2023
6211366
Fix the typo and therefore tests
coder2020official Dec 29, 2023
3b5d2d7
Fix tests attempt 2
coder2020official Dec 29, 2023
c04ae53
Added reply_parameters to sync
coder2020official Dec 29, 2023
545cedb
Fix some issues with the previous commit
coder2020official Dec 29, 2023
b8ef19d
Added support for linkpreviewoptions
coder2020official Dec 29, 2023
0485c31
Replaced the field disable_web_page_preview with link_preview_options…
coder2020official Dec 29, 2023
a261174
Added the field link_preview_options to the class Message with infor…
coder2020official Dec 29, 2023
c406e6c
Added Copy,Delete,Forward Messages to sync and async
coder2020official Dec 29, 2023
254387d
Renamed the class KeyboardButtonRequestUser to KeyboardButtonRequest…
coder2020official Dec 29, 2023
350f7fe
Added the class UsersShared. Replaced the field user_shared in the …
coder2020official Dec 29, 2023
e1c9223
Chat Boosts full support for handlers;
coder2020official Dec 30, 2023
137ea69
get_user_chat_boosts for sync and async; +UserChatBoosts
coder2020official Dec 30, 2023
ab2d1fa
Giveaways full support: start and end of giveaways, and information a…
coder2020official Dec 30, 2023
e290f27
Added the fields has_visible_story, accent_color_id, background_cust…
coder2020official Dec 30, 2023
af6f485
Added the class MessageOrigin and replaced the fields forward_from, …
coder2020official Dec 30, 2023
e94d5ce
Added InaccessibleMessage support, not sure on the implementation for…
coder2020official Dec 30, 2023
456a9ed
Minor utils edit that adds all update types
coder2020official Dec 30, 2023
39abb9d
Fix a typo
coder2020official Dec 30, 2023
87404d3
Set func=None by default for new handlers;
coder2020official Dec 30, 2023
bc8120e
Fix issues related with reactions handlers
coder2020official Dec 30, 2023
f081ec8
Fix de_json for some classes
coder2020official Dec 30, 2023
05a939b
Fix reply_markup issue with reply_parameters conflict
coder2020official Dec 31, 2023
52a0314
Fix naming in Update class
Badiboy Jan 2, 2024
79cc127
reply_to_message_id and allow_sending_without_reply deprecation
Badiboy Jan 2, 2024
56fbcaf
disable_web_page_preview deprecation
Badiboy Jan 2, 2024
778a02c
Fix forward_messages return value
Badiboy Jan 2, 2024
0af7f6f
Fix forward_messages return value in Async
Badiboy Jan 2, 2024
0ace17b
Fix the fix forward_messages return value
Badiboy Jan 2, 2024
578d6a3
Fix message_reaction_x_handler description
Badiboy Jan 2, 2024
4359f4f
Fix message_reaction_x_handler description for Async
Badiboy Jan 2, 2024
9831ae2
Fix and align reply_parameters
Badiboy Jan 3, 2024
71f53d3
Fix minor bugs in types.py
Badiboy Jan 3, 2024
b96084f
reply_parameters => to_json
Badiboy Jan 3, 2024
0c9bdfb
Fix classes loading in types.py
Badiboy Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
<p align="center">Both synchronous and asynchronous.</p>

## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api-changelog#september-22-2023">6.9</a>!
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#december-29-2023">7.0</a>!

<h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
<h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
Expand Down
1,292 changes: 1,073 additions & 219 deletions telebot/__init__.py

Large diffs are not rendered by default.

272 changes: 155 additions & 117 deletions telebot/apihelper.py

Large diffs are not rendered by default.

786 changes: 728 additions & 58 deletions telebot/async_telebot.py

Large diffs are not rendered by default.

260 changes: 144 additions & 116 deletions telebot/asyncio_helper.py

Large diffs are not rendered by default.

1,427 changes: 1,404 additions & 23 deletions telebot/types.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion telebot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
update_types = [
"message", "edited_message", "channel_post", "edited_channel_post", "inline_query", "chosen_inline_result",
"callback_query", "shipping_query", "pre_checkout_query", "poll", "poll_answer", "my_chat_member", "chat_member",
"chat_join_request",
"chat_join_request", "message_reaction", "message_reaction_count", "chat_boost", "removed_chat_boost",
]


Expand Down
12 changes: 10 additions & 2 deletions tests/test_handler_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ def update_type(message):
my_chat_member = None
chat_member = None
chat_join_request = None
message_reaction = None
message_reaction_count = None
chat_boost = None
chat_boost_removed = None
return types.Update(1001234038283, message, edited_message, channel_post, edited_channel_post, inline_query,
chosen_inline_result, callback_query, shipping_query, pre_checkout_query, poll, poll_answer,
my_chat_member, chat_member, chat_join_request)
my_chat_member, chat_member, chat_join_request, message_reaction, message_reaction_count, chat_boost, chat_boost_removed)


@pytest.fixture()
Expand All @@ -85,9 +89,13 @@ def reply_to_message_update_type(reply_to_message):
my_chat_member = None
chat_member = None
chat_join_request = None
message_reaction = None
message_reaction_count = None
chat_boost = None
chat_boost_removed = None
return types.Update(1001234038284, reply_to_message, edited_message, channel_post, edited_channel_post,
inline_query, chosen_inline_result, callback_query, shipping_query, pre_checkout_query,
poll, poll_answer, my_chat_member, chat_member, chat_join_request)
poll, poll_answer, my_chat_member, chat_member, chat_join_request, message_reaction, message_reaction_count, chat_boost, chat_boost_removed)


def next_handler(message):
Expand Down
6 changes: 5 additions & 1 deletion tests/test_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,13 @@ def create_message_update(text):
my_chat_member = None
chat_member = None
chat_join_request = None
message_reaction = None
message_reaction_count = None
chat_boost = None
chat_boost_removed = None
return types.Update(-1001234038283, message, edited_message, channel_post, edited_channel_post, inline_query,
chosen_inline_result, callback_query, shipping_query, pre_checkout_query, poll, poll_answer,
my_chat_member, chat_member, chat_join_request)
my_chat_member, chat_member, chat_join_request, message_reaction, message_reaction_count, chat_boost, chat_boost_removed)

def test_is_string_unicode(self):
s1 = u'string'
Expand Down
Loading