# Node red sending picture to telegram

**URL:** <https://discourse.nodered.org/t/node-red-sending-picture-to-telegram/39656>\
**Category:** General\
**Tags:** telegram\
**Created:** [24 January 2021 16:27 UTC](https://discourse.nodered.org/t/node-red-sending-picture-to-telegram/39656 "2021-01-24T16:27:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 January 2021 19:25 UTC](https://discourse.nodered.org/t/node-red-sending-picture-to-telegram/39656/4 "2021-01-25T19:25:47Z")

</div>

In your original example, the issue is likely because you are **NOT** sending a buffer.

Here is a working example...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/df4f182fabb83f588322004ad1fd4507fdfff533.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0f2bae38da6a4f36e34c87add3d799e389f19a04.jpeg)

To make it work

- import the demo flow
- setup the BOT connection
- send `/picture` to your bot

NOTE: this demo uses [node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/f/af806c87574aabaa927adc754588d12f05e0faf7.png)

The demo flow...

```auto
[{"id":"4cdb400.5a8f3c","type":"telegram command","z":"5d3f964c.fef898","name":"/picture","command":"/picture","bot":"fa7a9376.321ce","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":1390,"y":1760,"wires":[["fdbea5e0.730e08"]]},{"id":"fdbea5e0.730e08","type":"http request","z":"5d3f964c.fef898","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":1410,"y":1840,"wires":[["352469a3.7bb1d6","d33bab75.38ecb8"]]},{"id":"352469a3.7bb1d6","type":"function","z":"5d3f964c.fef898","name":"send picture","func":"var pl = {\n content: msg.payload,\n message: `Hey ${msg.originalMessage.from.first_name}, here is the random piture you requested`,\n type : 'photo',\n chatId: msg.originalMessage.chat.id,\n chat: msg.originalMessage.chat,\n from: msg.originalMessage.from,\n message_id : msg.originalMessage.message_id\n}\n\nmsg.payload = pl;\n\n\n/* type can be one of the following\nphoto\naudio\nvideo\nsticker\nvoice\ndocument\n*/\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1610,"y":1840,"wires":[["b5d7e8fa.e4aa08","b2b89b56.bd20f8"]]},{"id":"b5d7e8fa.e4aa08","type":"telegram sender","z":"5d3f964c.fef898","name":"","bot":"","outputs":1,"x":1850,"y":1840,"wires":[[]]},{"id":"d33bab75.38ecb8","type":"debug","z":"5d3f964c.fef898","name":"The image","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1410,"y":1880,"wires":[]},{"id":"b2b89b56.bd20f8","type":"debug","z":"5d3f964c.fef898","name":"the telegram msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1630,"y":1880,"wires":[]},{"id":"fa7a9376.321ce","type":"telegram bot","z":"5d3f964c.fef898","botname":"mybot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

```

---

_[View the full topic](https://discourse.nodered.org/t/node-red-sending-picture-to-telegram/39656)._
