Telegram BOT API: how to change a photo (not the caption)
Asked Answered
R

1

5

I know that common messages, sent via

https://core.telegram.org/bots/api#sendmessage

can be edited in all the parts using

https://core.telegram.org/bots/api#editmessagetext

The problem I have is related to when sending an image with a text attached; in these cases I used

https://core.telegram.org/bots/api#sendphoto

When user interacts with the bot using the "inline_keyboard" I provided, Telegram send me a callback and in some case I need to 'replace' the message entirely.

I used

https://core.telegram.org/bots/api#editmessagecaption

And this works because I can remove old text, show the new one and remove the keyboard.

The problem is that editmessagecapition do no allow me to change the picture! I need, exactly, to remove it from the message.

Is there a way?

Rennin answered 11/7, 2018 at 20:5 Comment(0)
C
8

replacing media is new feature for users in last version of telegram. this feature is not present for bot til now.

Update: in bot API 4.0 that present yesterday, you can replace media with editMessageMedia method.

Cystic answered 12/7, 2018 at 16:55 Comment(1)
It's actually entirely unclear if there is a way to remove a piece of media from the message without deleting the message.Ressler

© 2022 - 2024 — McMap. All rights reserved.