Skip to content

Botapi 10.0#2592

Merged
Badiboy merged 30 commits into
eternnoir:masterfrom
coder2020official:botapi-10
May 23, 2026
Merged

Botapi 10.0#2592
Badiboy merged 30 commits into
eternnoir:masterfrom
coder2020official:botapi-10

Conversation

@coder2020official
Copy link
Copy Markdown
Collaborator

@coder2020official coder2020official commented May 10, 2026

May 8, 2026
Bot API 10.0

Guest Mode

  • Introduced support for guest mode, allowing bots to receive certain messages and issue replies within chats they are not a member of.
  • Added the field supports_guest_queries to the class User.
  • Added the fields guest_bot_caller_user and guest_bot_caller_chat to the class Message.
  • Added the field guest_query_id to the class Message.
  • Added the field guest_message to the class Update.
  • Added the class SentGuestMessage and the method answerGuestQuery.

Chat Management

Polls

  • Added the classes InputMediaSticker, InputMediaLocation, and InputMediaVenue.
  • Added the class PollMedia, representing a media in a poll.
  • Added the field media to the class Poll, allowing bots to see media in polls.
  • Added the field explanation_media to the class Poll, allowing bots to see media in quiz explanations.
  • Added the field media to the class PollOption, allowing bots to see media in poll options.
  • Added the class InputPollMedia and the parameters media and explanation_media to the method sendPoll, allowing bots to add media to polls.
  • Added the class InputPollOptionMedia and the field media to the class InputPollOption, allowing bots to add media to poll options.
  • Added the field members_only to the class Poll.
  • Added the parameter members_only to the method sendPoll.
  • Added the field country_codes to the class Poll.
  • Added the parameter country_codes to the method sendPoll.
  • Decreased the minimum number of poll options from 2 to 1.

Live photos

General

@coder2020official coder2020official requested a review from Badiboy May 10, 2026 18:15
@coder2020official
Copy link
Copy Markdown
Collaborator Author

@Badiboy I'm done, please check

@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 10, 2026

Took it.

@All-The-Foxes
Copy link
Copy Markdown
Contributor

All-The-Foxes commented May 21, 2026

@coder2020official

I figured I'd test this to see if it worked. This is missing despite being checked off.

Added the class InputPollMedia and the parameters media and explanation_media to the method sendPoll, allowing bots to add media to polls.

Result: TypeError: AsyncTeleBot.send_poll() got an unexpected keyword argument 'media'

@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 21, 2026

@coder2020official Sorry for delay, was hardly occupied. Started review, hope od it today.

@coder2020official
Copy link
Copy Markdown
Collaborator Author

Won't work for uploading files, will come back later

@coder2020official
Copy link
Copy Markdown
Collaborator Author

A little messy, should work though

Comment thread telebot/__init__.py
Comment thread telebot/__init__.py
Comment thread telebot/async_telebot.py
Comment thread telebot/async_telebot.py Outdated
Comment thread telebot/apihelper.py Outdated
Comment thread telebot/async_telebot.py Outdated
Comment thread telebot/asyncio_helper.py Outdated
@coder2020official
Copy link
Copy Markdown
Collaborator Author

Anything else?

@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 23, 2026

Looks fine! Thank you!!!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates pyTelegramBotAPI to support Telegram Bot API 10.0, adding new update types (guest mode), new API methods/parameters, and new data models for polls and live photos.

Changes:

  • Add guest mode support via new Update.guest_message handling, guest query answering, and related Message/User fields.
  • Add new Bot API methods/params (e.g., answerGuestQuery, sendLivePhoto, return_bots for getChatAdministrators, reaction deletion helpers, managed-bot access settings, user personal chat messages).
  • Add/extend types for poll media and live photos (e.g., PollMedia, InputMediaLivePhoto, paid-media live photo types).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/test_telebot.py Updates test helper to include guest_message in constructed Update.
tests/test_handler_backends.py Updates Update(...) construction to match new signature/fields.
telebot/util.py Adds guest_message to recognized update types.
telebot/types.py Adds/extends core API types for guest mode, polls media, live photos, paid-media live photo, bot access settings.
telebot/asyncio_helper.py Adds async API wrappers for new Bot API 10.0 methods/params and extends send_poll to support media + new flags.
telebot/async_telebot.py Wires new update handling + adds high-level async methods (guest queries, live photos, extended poll sending).
telebot/apihelper.py Adds sync API wrappers for new Bot API 10.0 methods/params and extends send_poll similarly.
telebot/__init__.py Wires new update handling + adds high-level sync methods (guest queries, live photos, extended poll sending).
README.md Bumps the documented supported Bot API version to 10.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread telebot/__init__.py Outdated
Comment thread telebot/async_telebot.py Outdated
Comment thread telebot/types.py
Comment thread telebot/types.py Outdated
Comment on lines +11688 to +11691

def to_dict(self):
data = super().to_dict()
data['photo'] = self.photo if service_utils.is_string(self.photo) else 'attach://{0}'.format(service_utils.generate_random_token())
Comment thread telebot/types.py
Comment on lines +7521 to +7535
def __init__(self, media: str, photo: str, caption: Optional[str] = None, parse_mode: Optional[str] = None,
caption_entities: Optional[List[MessageEntity]] = None, show_caption_above_media: Optional[bool] = None, has_spoiler: Optional[bool] = None):
super(InputMediaLivePhoto, self).__init__(type="live_photo", media=media, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities)
self.photo: str = photo
self.show_caption_above_media: Optional[bool] = show_caption_above_media
self.has_spoiler: Optional[bool] = has_spoiler

def to_dict(self):
json_dict = super(InputMediaLivePhoto, self).to_dict()
json_dict['photo'] = self.photo
if self.show_caption_above_media is not None:
json_dict['show_caption_above_media'] = self.show_caption_above_media
if self.has_spoiler is not None:
json_dict['has_spoiler'] = self.has_spoiler
return json_dict
Comment thread telebot/types.py
Comment thread telebot/__init__.py Outdated
Comment thread telebot/async_telebot.py Outdated
Comment thread README.md
@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 23, 2026

Last check from copilot...

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coder2020official
Copy link
Copy Markdown
Collaborator Author

Bruh will have to manually address suggested changes

@coder2020official
Copy link
Copy Markdown
Collaborator Author

This should work right..

@coder2020official
Copy link
Copy Markdown
Collaborator Author

Yeah seems to be working

@coder2020official
Copy link
Copy Markdown
Collaborator Author

Should be done @Badiboy please take a look at changes

@Badiboy Badiboy requested a review from Copilot May 23, 2026 19:23
@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 23, 2026

Looks like solved... One more round with copilot? :)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Comment thread telebot/types.py
Comment thread telebot/types.py
data = super().to_dict()
data['photo'] = self._photo_dic
return data

Comment thread telebot/types.py
Comment thread telebot/apihelper.py
Comment thread telebot/asyncio_helper.py
Comment thread telebot/async_telebot.py Outdated
Comment thread README.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coder2020official
Copy link
Copy Markdown
Collaborator Author

Uh @Badiboy isn't inputpaidmedia supposed to have the convert_input_media as a function to return the file?

@coder2020official
Copy link
Copy Markdown
Collaborator Author

@Badiboy could you fix the inputpaidmedia absence of convert_input_media in a separate PR?

@Badiboy
Copy link
Copy Markdown
Collaborator

Badiboy commented May 23, 2026

I'm a bit lost with all these medias. Let's merge, then I'll take a look.

@coder2020official
Copy link
Copy Markdown
Collaborator Author

then I'm done, please merge

@Badiboy Badiboy merged commit 0b0fb8e into eternnoir:master May 23, 2026
6 checks passed
@All-The-Foxes
Copy link
Copy Markdown
Contributor

Uh @Badiboy isn't inputpaidmedia supposed to have the convert_input_media as a function to return the file?

I would test it but I don't have the resources to pay for random media for test purposes nor am I sure how it even works. Ideally it would be great if it was working, but no one seems to use it anyway or if they did they haven't raised any issues with it.

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.

4 participants