Updates to the poll section in bot API 9.6#5202
Updates to the poll section in bot API 9.6#5202ouyooung wants to merge 7 commits intopython-telegram-bot:api-9.6-centralfrom
Conversation
harshil21
left a comment
There was a problem hiding this comment.
Good work so far! About the deprecated things in this API update, this PR shows how we've done it in the past. Note the comments in the code which says "tags", and the warnings which are raised in the code if something deprecated is used. Can you implement that too?
| allows_multiple_answers: bool | None = None, | ||
| correct_option_id: CorrectOptionID | None = None, | ||
| allows_multiple_answers: bool | None = None, | ||
| allows_revoting: bool | None = None, | ||
| allow_adding_options: bool | None = None, | ||
| hide_results_until_closes: bool | None = None, | ||
| correct_option_ids: CorrectOptionIds | None = None, | ||
| is_closed: bool | None = None, |
There was a problem hiding this comment.
this change is breaking. allows_multiple_answers should not be reordered.
|
|
||
| CorrectOptionID: TypeAlias = Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # pylint: disable=invalid-name | ||
|
|
||
| CorrectOptionIds: TypeAlias = tuple[Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], ...] |
There was a problem hiding this comment.
where is this documented to go up to 11?
| allows_multiple_answers: bool | None = None, | ||
| allows_revoting: bool | None = None, | ||
| allow_adding_options: bool | None = None, | ||
| hide_results_until_closes: bool | None = None, | ||
| correct_option_ids: CorrectOptionIds | None = None, |
There was a problem hiding this comment.
all the new options should be added after allow_paid_broadcast
| message_effect_id: str | None = None, | ||
| allow_paid_broadcast: bool | None = None, | ||
| *, | ||
| reply_to_message_id: int | None = None, |
There was a problem hiding this comment.
please revert this change of reordering.
| allows_multiple_answers: bool | None = None, | ||
| allows_revoting: bool | None = None, | ||
| allow_adding_options: bool | None = None, | ||
| hide_results_until_closes: bool | None = None, | ||
| correct_option_ids: CorrectOptionIds | None = None, | ||
| is_closed: bool | None = None, | ||
| description: str | None = None, | ||
| description_parse_mode: str | None = None, | ||
| description_entities: Sequence["MessageEntity"] | None = None, | ||
| shuffle_options: bool | None = None, |
There was a problem hiding this comment.
the same thing I said about the parameters in extbot.py applies here too.
| allows_revoting (:obj:`bool`): :obj:`True`, if the poll allows to change the chosen | ||
| answer options | ||
|
|
||
| .. versionadded:: NEXT.VERSION |
There was a problem hiding this comment.
same thing here, move the docstring down, and also make this an optional argument for now. Don't forget to add the "tag" comment down in the __init__ too
| description_parse_mode: str | None = None, | ||
| description_entities: Sequence["MessageEntity"] | None = None, | ||
| *, | ||
| reply_to_message_id: int | None = None, |
| Also used in the :paramref:`~telegram.Bot.send_poll.close_date` parameter of | ||
| :meth:`telegram.Bot.send_poll`. | ||
|
|
||
| .. versionadded:: NEXT.VERSION |
There was a problem hiding this comment.
this should be a ..versionchanged and mention that this was changed from 600 to 2628000 since bot api 9.6.
changes/unreleased/5202.ouyoung.toml
Outdated
There was a problem hiding this comment.
Can you delete this file, and instead add the new entry to the 5196 file like I did here?
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
…legram-bot into api-9.6-polls
Check-list for PRs
.. versionadded:: NEXT.VERSION,.. versionchanged:: NEXT.VERSION,.. deprecated:: NEXT.VERSIONor ``.. versionremoved:: NEXT.VERSION` to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)AUTHORS.rst(optional)__all__sIf 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
self._id_attrsand corresponding documentation__init__acceptsapi_kwargsas keyword-onlyAdded New Shortcuts
telegram.Chat&telegram.Userfor all methods that acceptchat/user_idtelegram.Messagefor all methods that acceptchat_idandmessage_idtelegram.Messageshortcuts: Addedquoteargument if methods acceptreply_to_message_idtelegram.CallbackQueryfor all methods that accept eitherchat_idandmessage_idorinline_message_idIf Relevant
telegram.constantsand shortcuts to them as class variablestelegram.Message.effective_attachmenttelegram.ext.ConversationHandler_extbot.pybot_methods.rstREADME.rst(including the badge) andtelegram.constants.BOT_API_VERSION_INFOtelegram.ext.ExtBotfor new methods that either accept areply_markupin some form or have a return type that is/containstelegram.Message