Skip to content

Bot API 10.0 Polls and deprecating positional InputMedia*.filename#5232

Merged
harshil21 merged 24 commits into
api-10.0-centralfrom
api-10.0-polls
Jun 4, 2026
Merged

Bot API 10.0 Polls and deprecating positional InputMedia*.filename#5232
harshil21 merged 24 commits into
api-10.0-centralfrom
api-10.0-polls

Conversation

@aelkheir
Copy link
Copy Markdown
Member

@aelkheir aelkheir commented May 10, 2026

Check-list for PRs

  • Added .. versionadded:: NEXT.VERSION, .. versionchanged:: NEXT.VERSION, .. deprecated:: NEXT.VERSION or ``.. versionremoved:: NEXT.VERSION` to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • Documented code changes according to the CSI standard
  • Added new classes & modules to the docs and all suitable __all__ s
  • Checked the Stability Policy in case of deprecations or changes to documented behavior

If the PR contains API changes (otherwise, you can ignore this passage)

  • Checked the Bot API specific sections of the Stability Policy
  • Created a PR to remove functionality deprecated in the previous Bot API release (see here)
  • New Classes
    • Added self._id_attrs and corresponding documentation
    • __init__ accepts api_kwargs as keyword-only
  • Added New Shortcuts
    • In telegram.Chat & telegram.User for all methods that accept chat/user_id
    • In telegram.Message for all methods that accept chat_id and message_id
    • For new telegram.Message shortcuts: Added quote argument if methods accept reply_to_message_id
    • In telegram.CallbackQuery for all methods that accept either chat_id and message_id or inline_message_id
  • If Relevant
    • Added new constants at telegram.constants and shortcuts to them as class variables
    • Linked new and existing constants in docstrings instead of hard-coded numbers and strings
    • Added new message types to telegram.Message.effective_attachment
    • Added new filters for new message (sub)types
    • Added or updated documentation for the changed class(es) and/or method(s)
    • Added the new method(s) to _extbot.py
    • Added or updated bot_methods.rst

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.

Awaiting some items from the Live Photos section (#5235)

Followed up on some items from #5202, mainly enforcing the runtime requirement of new params:

  • Replaced the field correct_option_id with the field correct_option_ids in the class Poll.
  • Added the field allows_revoting to the class Poll.
  • Added the field persistent_id to the class PollOption, representing a persistent identifier for the option.
  • Added the field option_persistent_ids to the class PollAnswer.

@aelkheir aelkheir added the ⚙️ bot-api affected functionality: bot-api label May 10, 2026
@aelkheir aelkheir mentioned this pull request May 18, 2026
37 tasks
aelkheir added 4 commits May 31, 2026 23:04
…0-polls-rebased

 Conflicts:
	docs/source/telegram.at-tree.rst
	src/telegram/__init__.py
	src/telegram/_files/inputmedia.py
	tests/_files/test_inputmedia.py
@aelkheir aelkheir marked this pull request as ready for review May 31, 2026 21:36
@harshil21 harshil21 added this to the v22.8 milestone Jun 1, 2026
@aelkheir aelkheir requested a review from harshil21 June 1, 2026 16:51
Copy link
Copy Markdown
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this! Just a few comments, otherwise looks really good.

Comment thread src/telegram/_files/inputmedia.py Outdated
Comment thread src/telegram/_files/inputmedia.py Outdated
Comment thread src/telegram/_files/inputmedia.py Outdated
Comment thread src/telegram/_bot.py Outdated
Comment thread src/telegram/_poll.py Outdated
Comment thread src/telegram/_poll.py
@aelkheir aelkheir requested a review from harshil21 June 4, 2026 16:52
Copy link
Copy Markdown
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

just a single typo, otherwise looks great (specially the changelog)!

Comment thread src/telegram/_files/inputmedia.py Outdated
@aelkheir aelkheir changed the title Bot API 10.0 Polls Bot API 10.0 Polls and deprecating positional InputMedia*.filename Jun 4, 2026
@harshil21 harshil21 merged commit b78d348 into api-10.0-central Jun 4, 2026
23 of 26 checks passed
@harshil21 harshil21 deleted the api-10.0-polls branch June 4, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ bot-api affected functionality: bot-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants