|
29 | 29 | from telegram._utils.argumentparsing import parse_sequence_arg
|
30 | 30 | from telegram._utils.datetime import extract_tzinfo_from_defaults, from_timestamp
|
31 | 31 | from telegram._utils.types import JSONDict
|
32 |
| -from telegram._utils.warnings import warn |
33 |
| -from telegram.warnings import PTBDeprecationWarning |
34 | 32 |
|
35 | 33 | if TYPE_CHECKING:
|
36 | 34 | from telegram import Bot
|
@@ -89,9 +87,11 @@ class PollAnswer(TelegramObject):
|
89 | 87 |
|
90 | 88 | .. versionchanged:: 20.5
|
91 | 89 | The order of :paramref:`option_ids` and :paramref:`user` is changed in
|
92 |
| - 20.5 as the latter one became optional. We currently provide |
93 |
| - backward compatibility for this but it will be removed in the future. |
94 |
| - Please update your code to use the new order. |
| 90 | + 20.5 as the latter one became optional. |
| 91 | +
|
| 92 | + .. versionchanged:: NEXT.VERSION |
| 93 | + Backward compatiblity for changed order of :paramref:`option_ids` and :paramref:`user` |
| 94 | + was removed. |
95 | 95 |
|
96 | 96 | Args:
|
97 | 97 | poll_id (:obj:`str`): Unique poll identifier.
|
@@ -145,21 +145,8 @@ def __init__(
|
145 | 145 | super().__init__(api_kwargs=api_kwargs)
|
146 | 146 | self.poll_id: str = poll_id
|
147 | 147 | self.voter_chat: Optional[Chat] = voter_chat
|
148 |
| - |
149 |
| - if isinstance(option_ids, User) or isinstance(user, tuple): |
150 |
| - warn( |
151 |
| - "From v20.5 the order of `option_ids` and `user` is changed as the latter one" |
152 |
| - " became optional. Please update your code to use the new order.", |
153 |
| - category=PTBDeprecationWarning, |
154 |
| - stacklevel=2, |
155 |
| - ) |
156 |
| - self.option_ids: Tuple[int, ...] = parse_sequence_arg(user) |
157 |
| - self.user: Optional[User] = option_ids |
158 |
| - else: |
159 |
| - self.option_ids: Tuple[int, ...] = parse_sequence_arg( # type: ignore[no-redef] |
160 |
| - option_ids |
161 |
| - ) |
162 |
| - self.user: Optional[User] = user # type: ignore[no-redef] |
| 148 | + self.option_ids: Tuple[int, ...] = parse_sequence_arg(option_ids) |
| 149 | + self.user: Optional[User] = user |
163 | 150 |
|
164 | 151 | self._id_attrs = (
|
165 | 152 | self.poll_id,
|
|
0 commit comments