Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
da8f38d
Added the field can_manage_bots to the class User. Added the class Ke…
coder2020official Apr 4, 2026
83c17c4
Merge branch 'master' of https://github.com/coder2020official/pyTeleg…
coder2020official Apr 4, 2026
69e110f
Added the class ManagedBotCreated and the field managed_bot_created t…
coder2020official Apr 4, 2026
6a7b210
Added updates about the creation of managed bots and the change of th…
coder2020official Apr 4, 2026
75da4bf
Added the methods getManagedBotToken and replaceManagedBotToken.
coder2020official Apr 4, 2026
88308b5
Added the class PreparedKeyboardButton and the method savePreparedKey…
coder2020official Apr 4, 2026
4936dd6
Replaced the field correct_option_id with the field correct_option_id…
coder2020official Apr 4, 2026
bbbee7b
sendPoll updated fully
coder2020official Apr 4, 2026
f7095b8
Added the field allows_revoting to the class Poll.
coder2020official Apr 4, 2026
bf1ae82
Added the fields description and description_entities to the class Poll.
coder2020official Apr 4, 2026
78a42f5
Fix tests and README
coder2020official Apr 4, 2026
22b008d
Added the field persistent_id to the class PollOption, representing a…
coder2020official Apr 5, 2026
288e18c
Added the field option_persistent_ids to the class PollAnswer.
coder2020official Apr 5, 2026
e36b464
Added added_by_user, addition_date, and added_by_chat to PollOption
coder2020official Apr 5, 2026
2951372
Added the class PollOptionAdded and the field poll_option_added to th…
coder2020official Apr 5, 2026
92a9ca2
Added the field poll_option_id to the class ReplyParameters, allowing…
coder2020official Apr 5, 2026
60485e0
Added the field reply_to_poll_option_id to the class Message.
coder2020official Apr 5, 2026
d790d5d
Allowed “date_time” entities in checklist title, checklist task text,…
coder2020official Apr 5, 2026
222b5dd
Fix tests
coder2020official Apr 5, 2026
0b51a81
Minor fixes
coder2020official Apr 5, 2026
bf8d739
Minor fixes - Bot API 9.6
coder2020official Apr 5, 2026
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#march-1-2026"><img src="https://img.shields.io/badge/Bot%20API-9.5-blue?logo=telegram" alt="Supported Bot API version"></a>
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api-changelog#april-3-2026"><img src="https://img.shields.io/badge/Bot%20API-9.6-blue?logo=telegram" alt="Supported Bot API version"></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
175 changes: 164 additions & 11 deletions telebot/__init__.py

Large diffs are not rendered by default.

39 changes: 35 additions & 4 deletions telebot/apihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,16 @@ def get_business_connection(token, business_connection_id):
payload = {'business_connection_id': business_connection_id}
return _make_request(token, method_url, params=payload , method='post')

def get_managed_bot_token(token, user_id):
method_url = 'getManagedBotToken'
payload = {'user_id': user_id}
return _make_request(token, method_url, params=payload , method='post')

def replace_managed_bot_token(token, user_id):
method_url = 'replaceManagedBotToken'
payload = {'user_id': user_id}
return _make_request(token, method_url, params=payload , method='post')

def delete_my_commands(token, scope=None, language_code=None):
method_url = r'deleteMyCommands'
payload = {}
Expand Down Expand Up @@ -2486,6 +2496,12 @@ def save_prepared_inline_message(token, user_id, result: types.InlineQueryResult
return _make_request(token, method_url, params=payload, method='post')


def save_prepared_keyboard_button(token, user_id, button):
method_url = 'savePreparedKeyboardButton'
payload = {'user_id': user_id, 'button': button.to_json()}
return _make_request(token, method_url, params=payload, method='post')


def create_invoice_link(token, title, description, payload, provider_token,
currency, prices, max_tip_amount=None, suggested_tip_amounts=None, provider_data=None,
photo_url=None, photo_size=None, photo_width=None, photo_height=None, need_name=None, need_phone_number=None,
Expand Down Expand Up @@ -2534,11 +2550,12 @@ def create_invoice_link(token, title, description, payload, provider_token,
# noinspection PyShadowingBuiltins
def send_poll(
token, chat_id, question, options,
is_anonymous = None, type = None, allows_multiple_answers = None, correct_option_id = None, explanation = None,
is_anonymous = None, type = None, allows_multiple_answers = None, explanation = None,
explanation_parse_mode=None, open_period = None, close_date = None, is_closed = None, disable_notification=False,
reply_markup=None, timeout=None, explanation_entities=None, protect_content=None, message_thread_id=None,
reply_parameters=None, business_connection_id=None, question_parse_mode=None, question_entities=None, message_effect_id=None,
allow_paid_broadcast=None):
allow_paid_broadcast=None, allows_revoting=None, shuffle_options=None, allow_adding_options=None, hide_results_until_closes=None,
correct_option_ids=None, description=None, description_parse_mode=None, description_entities=None):
method_url = r'sendPoll'
payload = {
'chat_id': str(chat_id),
Expand All @@ -2552,8 +2569,6 @@ def send_poll(
payload['type'] = type
if allows_multiple_answers is not None:
payload['allows_multiple_answers'] = allows_multiple_answers
if correct_option_id is not None:
payload['correct_option_id'] = correct_option_id
if explanation:
payload['explanation'] = explanation
if explanation_parse_mode:
Expand Down Expand Up @@ -2591,6 +2606,22 @@ def send_poll(
payload['message_effect_id'] = message_effect_id
if allow_paid_broadcast is not None:
payload['allow_paid_broadcast'] = allow_paid_broadcast
if allows_revoting is not None:
payload['allows_revoting'] = allows_revoting
if shuffle_options is not None:
payload['shuffle_options'] = shuffle_options
if allow_adding_options is not None:
payload['allow_adding_options'] = allow_adding_options
if hide_results_until_closes is not None:
payload['hide_results_until_closes'] = hide_results_until_closes
if correct_option_ids is not None:
payload['correct_option_ids'] = json.dumps(correct_option_ids)
if description is not None:
payload['description'] = description
if description_parse_mode is not None:
payload['description_parse_mode'] = description_parse_mode
if description_entities is not None:
payload['description_entities'] = json.dumps(types.MessageEntity.to_list_of_dicts(description_entities))
return _make_request(token, method_url, params=payload)

def create_forum_topic(token, chat_id, name, icon_color=None, icon_custom_emoji_id=None):
Expand Down
Loading
Loading