Skip to content

API 9.1 InputChecklist[Task] classes and bot.send/edit_checklist #4857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 16, 2025

Conversation

aelkheir
Copy link
Member

@aelkheir aelkheir commented Jul 7, 2025

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

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 handlers for new update types
    • 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
    • Updated the Bot API version number in all places: README.rst (including the badge) and telegram.constants.BOT_API_VERSION_INFO
    • Added logic for arbitrary callback data in telegram.ext.ExtBot for new methods that either accept a reply_markup in some form or have a return type that is/contains telegram.Message

API 9.1 Items:

  • Added the class InputChecklistTask representing a task to add to a checklist.
  • Added the class InputChecklist representing a checklist to create.
  • Added the method sendChecklist, allowing bots to send a checklist on behalf of a business account.
  • Added the method editMessageChecklist, allowing bots to edit a checklist on behalf of a business account.

I've skipped parse_entity utility methods for the classes InputChecklist[Task] as they're implemented on the returned version of the classes, and don't make much sense here imo.

@aelkheir aelkheir marked this pull request as ready for review July 8, 2025 23:04
@aelkheir aelkheir added the 📋 pending-review work status: pending-review label Jul 8, 2025
Comment on lines +3964 to +3967
Note:
You can only edit messages that the bot sent itself (i.e. of the ``bot.send_*`` family
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
Copy link
Member Author

@aelkheir aelkheir Jul 8, 2025

Choose a reason for hiding this comment

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

Was hesitant about this note section, whether it's relevant here, should be removed entirely, or made to say something like:

Suggested change
Note:
You can only edit messages that the bot sent itself (i.e. of the ``bot.send_*`` family
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
Note:
You can only edit messages that the bot sent itself (i.e. of the ``bot.send_*`` family
of methods). However, this
behaviour is undocumented and might be changed by Telegram.

It exists in most, if not all, other Message.edit_ shortcuts

Copy link
Member

Choose a reason for hiding this comment

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

If the text is mostly the same everywhere, I'd vote to keep it like that just for consistency :)

Copy link
Member

@Bibo-Joshi Bibo-Joshi 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 the nice PR and please excuse the late review :/ Not much to comment, you thought of everything IISC 🥳

Comment on lines +3964 to +3967
Note:
You can only edit messages that the bot sent itself (i.e. of the ``bot.send_*`` family
of methods) or channel posts, if the bot is an admin in that channel. However, this
behaviour is undocumented and might be changed by Telegram.
Copy link
Member

Choose a reason for hiding this comment

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

If the text is mostly the same everywhere, I'd vote to keep it like that just for consistency :)

@Bibo-Joshi Bibo-Joshi merged commit 6562625 into api-9.1 Jul 16, 2025
43 of 47 checks passed
@Bibo-Joshi Bibo-Joshi deleted the api-9.1-inputchecklist branch July 16, 2025 16:33
@aelkheir aelkheir removed the 📋 pending-review work status: pending-review label Jul 16, 2025
@aelkheir aelkheir mentioned this pull request Jul 20, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy