From 1f5cfc8f9b196ce3706b1337ff56d95d8521f2e3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:48:03 +0300 Subject: [PATCH] Move Parameter `ReplyParameters.checklist_task_id` to Last Position (#4972) --- changes/unreleased/4972.RX4QftpcFPCv2wXbTAhDAh.toml | 10 ++++++++++ src/telegram/_reply.py | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 changes/unreleased/4972.RX4QftpcFPCv2wXbTAhDAh.toml diff --git a/changes/unreleased/4972.RX4QftpcFPCv2wXbTAhDAh.toml b/changes/unreleased/4972.RX4QftpcFPCv2wXbTAhDAh.toml new file mode 100644 index 000000000..4fca643fb --- /dev/null +++ b/changes/unreleased/4972.RX4QftpcFPCv2wXbTAhDAh.toml @@ -0,0 +1,10 @@ +breaking = """Move param ``ReplyParameters.checklist_task_id`` to last position. + +.. hint:: + This change addresses a breaking change accidentally introduced in version 22.4 where the introduction of the new parameter was not done in a backward compatible way. + Existing code using keyword arguments is unaffected. Only code using positional arguments (and based on version 22.4) may need updates. +""" +[[pull_requests]] +uid = "4972" +author_uids = ["aelkheir"] +closes_threads = [] diff --git a/src/telegram/_reply.py b/src/telegram/_reply.py index 750820d28..3bfe41250 100644 --- a/src/telegram/_reply.py +++ b/src/telegram/_reply.py @@ -377,6 +377,12 @@ class ReplyParameters(TelegramObject): .. versionadded:: 20.8 + .. versionchanged:: NEXT.VERSION + The :paramref:`checklist_task_id` parameter has been moved to the last position to + maintain backward compatibility with versions prior to 22.4. + This resolves a breaking change accidentally introduced in version 22.4. See the changelog + for version NEXT.VERSION for more information. + Args: message_id (:obj:`int`): Identifier of the message that will be replied to in the current chat, or in the chat :paramref:`chat_id` if it is specified. @@ -449,11 +455,11 @@ class ReplyParameters(TelegramObject): message_id: int, chat_id: Optional[Union[int, str]] = None, allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE, - checklist_task_id: Optional[int] = None, quote: Optional[str] = None, quote_parse_mode: ODVInput[str] = DEFAULT_NONE, quote_entities: Optional[Sequence[MessageEntity]] = None, quote_position: Optional[int] = None, + checklist_task_id: Optional[int] = None, *, api_kwargs: Optional[JSONDict] = None, ):