windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
256 stars 117 forks source link

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

Closed temkagordin closed 10 months ago

temkagordin commented 10 months ago

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 10 months ago

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

temkagordin commented 10 months ago

@windkh nothing

image

last was when sent

image
windkh commented 10 months ago

Please send me the flow

temkagordin commented 10 months ago

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 10 months ago

Good thanks