# Help with generating a jpg from raw mqtt data and sending via telegam

**URL:** <https://discourse.nodered.org/t/help-with-generating-a-jpg-from-raw-mqtt-data-and-sending-via-telegam/54333>\
**Category:** General\
**Created:** [26 November 2021 12:58 UTC](https://discourse.nodered.org/t/help-with-generating-a-jpg-from-raw-mqtt-data-and-sending-via-telegam/54333 "2021-11-26T12:58:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [26 November 2021 14:48 UTC](https://discourse.nodered.org/t/help-with-generating-a-jpg-from-raw-mqtt-data-and-sending-via-telegam/54333/2 "2021-11-26T14:48:19Z")

</div>

You set the buffer as `msg.payload.content`

Here are 3 working examples...

> [@Unable to send text\_link from telegram bot](https://discourse.nodered.org/t/unable-to-send-text-link-from-telegram-bot/45615/4):
>
> Try using markdown... msg.payload = { content: msg.payload, //the image buffer caption: `There's someone at the door. [Live Image](http://camera_url).`, type : 'photo', chatId: "xxxx" } msg.payload.options = { parse\_mode : "Markdown" }; return msg;

> [@Node red sending picture to telegram](https://discourse.nodered.org/t/node-red-sending-picture-to-telegram/39656/4):
>
> In your original example, the issue is likely because you are NOT sending a buffer. Here is a working example... 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) The demo flow... [{"id":"4cdb400.5a8f3c","type":"telegram command","z":"5d3f964c.fef898","name":"/picture","command":"/picture","bot":"fa7a9376.321ce","strict":false,"hasresponse":false,"useregex":false,"removere…

> [@Taking a picture and sending it via telegram](https://discourse.nodered.org/t/taking-a-picture-and-sending-it-via-telegram/27905/4):
>
> msg.payload.content can also be a buffer object Are you able to get the image from the webcam into a buffer? Here is a demo i did... [{"id":"99ee972c.22d088","type":"telegram sender","z":"5d3f964c.fef898","name":"","bot":"fa7a9376.321ce","x":930,"y":280,"wires":[["72b71335.355a9c"]]},{"id":"58e78fc.dd0b27","type":"telegram command","z":"5d3f964c.fef898","name":"/pic","command":"/pic","bot":"fa7a9376.321ce","strict":false,"hasresponse":false,"x":130,"y":280,"wires":[["3eb66…

---

_[View the full topic](https://discourse.nodered.org/t/help-with-generating-a-jpg-from-raw-mqtt-data-and-sending-via-telegam/54333)._
