Skip to content

Bot API 10.0 Polls#5232

Draft
aelkheir wants to merge 3 commits intoapi-10.0-centralfrom
api-10.0-polls
Draft

Bot API 10.0 Polls#5232
aelkheir wants to merge 3 commits intoapi-10.0-centralfrom
api-10.0-polls

Conversation

@aelkheir
Copy link
Copy Markdown
Member

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.