I want to send group of photos via using telegram sender. I am using "node-red-contrib-telegrambot"
My nodes looks like this
the first function returns the path of the photos like this; (the photos are located on my server locally)
//return path of photos
let numberpage = 609;
msg.payload = [
`/data/photos/${numberpage}.jpg`,
`/data/photos/${numberpage + 1}.jpg`,
];
return [msg];
Then i split them and i read these files and join together and i create a buffer like this which contains two images.
//debug 7 looks like this
msg.payload : array[2]
array[2]
0: buffer[1892013]
1: buffer[1651348]
And then i take this two array as content for sending as a message. It looks like this;
//content for message function node
var msg = {
chatId: 9999999, //example
content: msg.payload, //here should come the 2 images.
type: "photo"
}
return msg;
But i get this error.
msg : string[20]
"msg.payload is empty"
I think there is a problem with the last function. Because it gives me msg.payload is empty.
Can someone help me? Thanks