The caption_entities parameter should properly format the caption for media messages such as photos, videos, and documents. When using the following code snippet:
The resulting caption should render with formatting applied:
This is ||an example|| caption
Actual Behavior
The message is sent, but the caption_entities parameter is ignored, and the caption appears as plain text:
This is an example caption
No formatting (e.g., underline, spoiler, bold) is applied.
Steps to reproduce the Behavior
Use the sendPhoto method with the code snippet above.
Observe that the caption is sent as plain text, ignoring the caption_entities.
Compare this to the behavior of entities for text messages, which applies formatting correctly.
This seems like a bug where the caption_entities field is either not processed or incorrectly passed to the Telegram Bot API. If the implementation is correct, clarification in the documentation would also be helpful. Thank you for your attention to this matter!
Bug Report
I have read:
I am using the latest version of the library.
Expected Behavior
The
caption_entities
parameter should properly format the caption for media messages such as photos, videos, and documents. When using the following code snippet:The resulting caption should render with formatting applied:
Actual Behavior
The message is sent, but the
caption_entities
parameter is ignored, and the caption appears as plain text:No formatting (e.g., underline, spoiler, bold) is applied.
Steps to reproduce the Behavior
sendPhoto
method with the code snippet above.caption_entities
.entities
for text messages, which applies formatting correctly.This seems like a bug where the
caption_entities
field is either not processed or incorrectly passed to the Telegram Bot API. If the implementation is correct, clarification in the documentation would also be helpful. Thank you for your attention to this matter!