Open nmlorg opened 4 days ago
(After a power outage just for fun…)
Calling editMessageMedia
on a sendMessage
d message converts it to a media message altogether, and its existing text
is simply discarded. If you want it to have text, you have to supply a caption=
to editMessageMedia
(as part of the media=
argument).
media.media=None
, =''
, or sending a media=
without an internal media=
all emit a 400 from TBA.editMessageText
on a converted message throws a 400 ("there is no text in the message to edit"
).So this would be a one-way process: If the record for a message that didn't include any image when sent is changed so that the message would have included an image if it were sent now, we can go ahead and add the image. That's it :slightly_frowning_face:.
https://core.telegram.org/bots/api#october-31-2024:
editMessageText
to change the text, or do you have to useeditMessageCaption
after adding an image?sendMessage(text='a' * 2000)
, theneditMessageMedia
to add a picture, does it fail, does it change to a message withcaption='a' * 2000
, does it change to a message withcaption='a' * 1024
, or what?caption='a' * 2000
, can youeditMessageCaption(caption='b' * 2000)
? Can you edit it at all, or is it stuck? Can you remove the image, edit the text, then readd the image?Depending on how this turns out, I'd like to start sending all announcements as text messages, immediately editing them to add media (if appropriate), and also keeping media updated (including removing it) as event titles/etc. change.