You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The caption_entities parameter should properly format the caption for media messages such as photos, videos, and documents. When using the following code snippet:
awaitbot.sendPhoto(targetChatId,fileId,{caption: "This is an example caption",caption_entities: [{offset: 0,length: 8,type: 'underline'},{offset: 9,length: 10,type: 'spoiler'},{offset: 19,length: 8,type: 'bold'}],});
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!
The text was updated successfully, but these errors were encountered:
While I understand that some behaviors may seem expected based on previous experiences with the library, the caption_entities parameter should work the same way as the entities parameter for text messages, applying formatting to captions.
If this limitation is inherent to the library, it would be helpful to explicitly document it, as it affects the functionality of bots that rely on formatted captions. Clarifying whether this is a limitation of the library or an issue with how the parameter is being handled would help developers avoid confusion.
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!The text was updated successfully, but these errors were encountered: