How to send a picture through Telegram?

I am trying to do something very simple, but i just can't get it to work. I want to send a picture of a cat thats stored on my raspberry pi: /home/pi/Pictures/cat.jpg

I have the flow like this:

And in the function i have the following:

msg.payload = {chatId: msg.chatId, type: "photo", content:msg.filename, caption:"Picture of cat"};

return msg;

I am unsure how to point to the filename correctly and if my flow is correct?

I have search everywhere for a working example on how to do this, and none seems to work.

Hope someone can guide me in the right direction :slight_smile:

Just for the record, my telegram is working fine with messages :slight_smile:

Without the actual flow, a bit hard to tell, but the above looks ok. Although for debugging (and Prod) I would substitute the function node for a Change node. It makes visualising what is happening a bit easier.

Also, put in the absolute path and name of the image file, and hard code your chatid as well. Again, easy to do using a Change node.