telebot
telebot copied to clipboard
Any example of editMessageMedia?
Hello,
I am sending photo using bot.sendPhoto
method. After some time I want to edit the photo.
I found a method editMessageMedia
but there is no example how to use it.
Is there any example of editMessageMedia?
As per the source code media
required object.
editMessageMedia: {
arguments(media, opt = {}) {
const form = {};
if (opt.chatId) form.chat_id = opt.chatId;
if (opt.messageId) form.message_id = opt.messageId;
if (opt.inlineMessageId) form.inline_message_id = opt.inlineMessageId;
form.media = JSON.stringify(media);
return form;
}
}
What should be the media
parameter?
I have this same problem. Nothing seem to work
You can use official Telegram Bot API reference
const chatId = 123,
messageId = 321,
media = {type: 'photo', media: 'https://telegram.org/img/apple-touch-icon.png'}
bot.editMessageMedia(media, {chatId, messageId})