Skip to content

Add rich message send API surface#5275

Closed
tymrtn wants to merge 2 commits into
python-telegram-bot:masterfrom
tymrtn:rich-message-send-surface
Closed

Add rich message send API surface#5275
tymrtn wants to merge 2 commits into
python-telegram-bot:masterfrom
tymrtn:rich-message-send-surface

Conversation

@tymrtn

@tymrtn tymrtn commented Jun 18, 2026

Copy link
Copy Markdown

Summary

Adds the first send-side Rich Messages API surface for Bot API 10.1:

  • InputRichMessage
  • InputRichMessageContent
  • Bot.send_rich_message
  • Bot.send_rich_message_draft
  • ExtBot wrappers
  • Chat / User shortcuts
  • Message.reply_rich_message
  • docs entries and targeted unit tests

This intentionally does not add the full RichText* / RichBlock* returned-object hierarchy yet. It is meant as a smaller first slice for sending rich markdown/html content and rich drafts.

Closes part of #5261.

Tests

  • python -m pytest -o 'addopts=' tests/test_inputrichmessage.py tests/test_bot.py::TestBotWithoutRequest::test_send_rich_message tests/test_bot.py::TestBotWithoutRequest::test_send_rich_message_draft tests/test_chat.py::TestChatWithoutRequest::test_instance_method_send_rich_message tests/test_chat.py::TestChatWithoutRequest::test_instance_method_send_rich_message_draft tests/test_user.py::TestUserWithoutRequest::test_instance_method_send_rich_message tests/test_user.py::TestUserWithoutRequest::test_instance_method_send_rich_message_draft tests/test_message.py::TestMessageWithoutRequest::test_reply_rich_message -q
  • python -m pytest -o 'addopts=' tests/test_inputrichmessage.py tests/test_bot.py tests/test_chat.py tests/test_user.py tests/test_message.py -k 'rich_message or inputrichmessage' -q
  • PYTHONPATH=src python - <<'PY' ... import/export sanity for InputRichMessage/InputRichMessageContent/Bot/Chat/User/Message ... PY
  • git diff --check
  • python -m ruff check src/telegram/_inputrichmessage.py src/telegram/_bot.py src/telegram/_chat.py src/telegram/_user.py src/telegram/_message.py src/telegram/ext/_extbot.py tests/test_inputrichmessage.py tests/test_bot.py tests/test_chat.py tests/test_user.py tests/test_message.py
  • python -m ruff format --check src/telegram/_inputrichmessage.py src/telegram/_bot.py src/telegram/_chat.py src/telegram/_user.py src/telegram/_message.py src/telegram/ext/_extbot.py tests/test_inputrichmessage.py tests/test_bot.py tests/test_chat.py tests/test_user.py tests/test_message.py

Check-list for PRs

  • Added .. versionadded:: NEXT.VERSION to user-facing changes
  • Created new/adapted unit tests
  • Documented code changes according to existing project style
  • Added myself alphabetically to AUTHORS.rst (optional)
  • Added new classes & modules to docs and suitable __all__ exports
  • Checked Bot API-specific PR checklist items relevant to this slice

@Phil9l

Phil9l commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Cross-linking for coordination: I've folded the non-overlapping pieces from here (via @tymrtn's PR against my fork) into #5263, with Tyler's authorship preserved. That PR now covers the full send-side surface — InputRichMessage + InputRichMessageContent, Bot / Chat / User shortcuts, Message.reply_rich_message, docs and tests.

To avoid two competing PRs I'd propose we consolidate on #5263, but I'll defer to @tymrtn and the maintainers on whether to close this one. Thanks again for the collaborative approach!

@tymrtn

tymrtn commented Jun 18, 2026

Copy link
Copy Markdown
Author

Thanks @Phil9l — confirmed. Since the non-overlapping pieces from this PR have now been folded into #5263 with authorship preserved, I'm closing this one to avoid duplicate review tracks.

Let's consolidate on #5263 for the send-side Bot API 10.1 rich-message slice. The remaining red test_official status there is expected for now because the full receive-side RichText* / RichBlock* hierarchy is intentionally out of scope for that slice.

@tymrtn tymrtn closed this Jun 18, 2026
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