windkh/node-red-contrib-telegrambot

I want to replace photo it with a document that is located locally

temkagordin opened this issue · 5 comments

I send a photo with caption to telegram, after i want replace it as pdf file

var options = {
    chat_id: CHAT_ID,
    message_id: MESSAGE_ID
};

var inputMediaPhoto = {
    type: "document",
    media: msg.filepath // document path like /var/www/aaa/test.pdf
}

msg.payload = {
    type: 'editMessageMedia',
    content: inputMediaPhoto,
    options: options,

}
return msg;

after send from telegram node not have response, and image was not replaced

windkh commented

Please add a debug node to the sender: what is the output?

@windkh nothing
image
last was when sent
image

windkh commented

Please send me the flow

I found explanation of my problem

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

Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise.

windkh commented

Good thanks