Botapi 10.0#2592
Conversation
…he class Message.
…icted and ChatPermissions.
…media in poll options.
…et_managed_bot_access_settings
|
@Badiboy I'm done, please check |
|
Took it. |
|
I figured I'd test this to see if it worked. This is missing despite being checked off.
Result: TypeError: AsyncTeleBot.send_poll() got an unexpected keyword argument 'media' |
|
@coder2020official Sorry for delay, was hardly occupied. Started review, hope od it today. |
|
Won't work for uploading files, will come back later |
|
A little messy, should work though |
|
Anything else? |
|
Looks fine! Thank you!!! |
There was a problem hiding this comment.
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_messagehandling, guest query answering, and relatedMessage/Userfields. - Add new Bot API methods/params (e.g.,
answerGuestQuery,sendLivePhoto,return_botsforgetChatAdministrators, 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.
|
|
||
| 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()) |
| 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 |
|
Last check from copilot... |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Bruh will have to manually address suggested changes |
|
This should work right.. |
|
Yeah seems to be working |
|
Should be done @Badiboy please take a look at changes |
|
Looks like solved... One more round with copilot? :) |
| data = super().to_dict() | ||
| data['photo'] = self._photo_dic | ||
| return data | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Uh @Badiboy isn't inputpaidmedia supposed to have the convert_input_media as a function to return the file? |
|
@Badiboy could you fix the inputpaidmedia absence of convert_input_media in a separate PR? |
|
I'm a bit lost with all these medias. Let's merge, then I'll take a look. |
|
then I'm done, please merge |
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. |
May 8, 2026
Bot API 10.0
Guest Mode
Chat Management
Polls
Live photos
General