Add rich message send API surface#5275
Conversation
|
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! |
|
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 |
Summary
Adds the first send-side Rich Messages API surface for Bot API 10.1:
InputRichMessageInputRichMessageContentBot.send_rich_messageBot.send_rich_message_draftExtBotwrappersChat/UsershortcutsMessage.reply_rich_messageThis 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 -qpython -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' -qPYTHONPATH=src python - <<'PY' ... import/export sanity for InputRichMessage/InputRichMessageContent/Bot/Chat/User/Message ... PYgit diff --checkpython -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.pypython -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.pyCheck-list for PRs
.. versionadded:: NEXT.VERSIONto user-facing changesAUTHORS.rst(optional)__all__exports