I found two issues with editEphemeralMessageText.
1. Wrong character limit:
According to the docs, the text limit is 4096 characters, but the method throws an error when text is > 1024 characters.
2. Wrong error type:
When the limit is exceeded, it throws MEDIA_CAPTION_TOO_LONG, which is incorrect for a text message. The expected error should be MESSAGE_TOO_LONG.
The error MEDIA_CAPTION_TOO_LONG should only apply to media captions (which have a 1024 limit), not to editEphemeralMessageText.
Steps to Reproduce:
curl -X POST "https://api.telegram.org/bot<TOKEN>/editEphemeralMessageText"
-H "Content-Type: application/json"
-d '{
"chat_id": -100xx,
"receiver_user_id": 123xxx,
"ephemeral_message_id": 123xxx,
"text": "'$(printf '0%.0s' {1..1025})'"
}'
Expected:
- Should accept up to 4096 characters
- If > 4096, should return
MESSAGE_TOO_LONG
Actual:
- Fails at > 1024 characters
- Returns
MEDIA_CAPTION_TOO_LONG
Looks like the backend is validating this as a caption, not as a message text.
Thanks!
I found two issues with
editEphemeralMessageText.1. Wrong character limit:
According to the docs, the
textlimit is 4096 characters, but the method throws an error when text is > 1024 characters.2. Wrong error type:
When the limit is exceeded, it throws
MEDIA_CAPTION_TOO_LONG, which is incorrect for a text message. The expected error should beMESSAGE_TOO_LONG.The error
MEDIA_CAPTION_TOO_LONGshould only apply to media captions (which have a 1024 limit), not toeditEphemeralMessageText.Steps to Reproduce:
curl -X POST "https://api.telegram.org/bot<TOKEN>/editEphemeralMessageText"
-H "Content-Type: application/json"
-d '{
"chat_id": -100xx,
"receiver_user_id": 123xxx,
"ephemeral_message_id": 123xxx,
"text": "'$(printf '0%.0s' {1..1025})'"
}'
Expected:
MESSAGE_TOO_LONGActual:
MEDIA_CAPTION_TOO_LONGLooks like the backend is validating this as a caption, not as a message text.
Thanks!