# Telegram - how to send an image

**URL:** <https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416>\
**Category:** General\
**Created:** [7 January 2025 04:53 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416 "2025-01-07T04:53:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le-Ze](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Le-Ze](https://discourse.nodered.org/u/Le-Ze)\
**Post date:** [7 January 2025 04:53 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/1 "2025-01-07T04:53:22Z")

</div>

Hi.

> **[Sending and receiving Telegram messages with Node-RED • FlowFuse](https://flowfuse.com/node-red/notification/telegram/)**
>
> Learn to seamlessly integrate Telegram with Node-RED for messaging. Create bots, obtain chat IDs, and send/receive messages, including group messaging.

Sending a message to telegram. it works.  
I don't know how to add an image.  
Advice?  
Thank you.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [7 January 2025 05:08 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/2 "2025-01-07T05:08:23Z")

</div>

Did you check in the built in examples ?

---

<div class="post-metadata">

**Author:** ![Le-Ze](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Le-Ze](https://discourse.nodered.org/u/Le-Ze)\
**Post date:** [7 January 2025 08:19 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/3 "2025-01-07T08:19:11Z")

</div>

> **[node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot)**
>
> Telegram bot nodes for Node-RED

I can send text (Message).  
I can send a photo.  
I can't send text + photo at once

 ![nodephoto](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/ed847944a830b0b13596450dd91ec250914fd3d6.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [7 January 2025 08:25 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/4 "2025-01-07T08:25:19Z")

</div>

No at computer, but i seem to remember that you can send a caption with a image. msg.payload.caption I think. [https://raw.githubusercontent.com/windkh/node-red-contrib-telegrambot/refs/heads/master/examples/sendphoto.json](https://raw.githubusercontent.com/windkh/node-red-contrib-telegrambot/refs/heads/master/examples/sendphoto.json)

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [7 January 2025 09:46 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/5 "2025-01-07T09:46:21Z")

</div>

This is a simple flow example (if you would like to view the image being sent in the NR editor, please install node-red-contrib-image-tools ). The example monitors a folder and if you drop an image to it, it will be read and sent. Obviously you can feed the function node with image data directly in other ways

 ![Skärmavbild 2025-01-07 kl. 10.43.42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6b443b2e33b14fbd316fa2dea24ee73d88b30c4f.png)

```auto
[
    {
        "id": "88d8ff214f48ece7",
        "type": "function",
        "z": "be169c56949ba685",
        "name": "Create image for Telegram",
        "func": "var cId = 123456;\n\nmsg.payload = { chatId: cId, type:\"photo\", content:msg.payload, caption:\"Snapshot of image\"};\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 730,
        "y": 80,
        "wires": [
            [
                "95114cabc3339005"
            ]
        ]
    },
    {
        "id": "95114cabc3339005",
        "type": "telegram sender",
        "z": "be169c56949ba685",
        "name": "",
        "bot": "a0a9832f.04aa5",
        "haserroroutput": false,
        "outputs": 1,
        "x": 980,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "47abe4fc60e4e1ae",
        "type": "image viewer",
        "z": "be169c56949ba685",
        "name": "",
        "width": 160,
        "data": "payload",
        "dataType": "msg",
        "active": true,
        "x": 720,
        "y": 150,
        "wires": [
            []
        ]
    },
    {
        "id": "d9231585ae2a792b",
        "type": "file in",
        "z": "be169c56949ba685",
        "name": "",
        "filename": "filename",
        "filenameType": "msg",
        "format": "",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 500,
        "y": 80,
        "wires": [
            [
                "88d8ff214f48ece7",
                "47abe4fc60e4e1ae",
                "c8aa613381b1b29b"
            ]
        ]
    },
    {
        "id": "dd24b7769ad4adf7",
        "type": "watch",
        "z": "be169c56949ba685",
        "name": "",
        "files": "/home/pi/Pictures",
        "recursive": "",
        "x": 170,
        "y": 80,
        "wires": [
            [
                "86107013c36ba942"
            ]
        ]
    },
    {
        "id": "946937a69c9686d3",
        "type": "comment",
        "z": "be169c56949ba685",
        "name": "Monitor folder for new images and send them via Telegram",
        "info": "",
        "x": 290,
        "y": 40,
        "wires": []
    },
    {
        "id": "86107013c36ba942",
        "type": "delay",
        "z": "be169c56949ba685",
        "name": "",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 350,
        "y": 80,
        "wires": [
            [
                "d9231585ae2a792b"
            ]
        ]
    },
    {
        "id": "a0a9832f.04aa5",
        "type": "telegram bot",
        "botname": "Testchat",
        "usernames": "",
        "chatids": "",
        "baseapiurl": "",
        "updatemode": "polling",
        "pollinterval": "300",
        "usesocks": false,
        "sockshost": "",
        "socksport": "6667",
        "socksusername": "anonymous",
        "sockspassword": "",
        "bothost": "",
        "botpath": "",
        "localbotport": "8443",
        "publicbotport": "8443",
        "privatekey": "",
        "certificate": "",
        "useselfsignedcertificate": false,
        "sslterminated": false,
        "verboselogging": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [7 January 2025 10:16 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/6 "2025-01-07T10:16:37Z")

</div>

I think you will find `msg.payload.type` should be 'photo' not 'message' in the 'change' node.

You can also include a caption for the photo with...

`msg.payload.caption` "this is a photo of a cat"

---

<div class="post-metadata">

**Author:** ![Le-Ze](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Le-Ze](https://discourse.nodered.org/u/Le-Ze)\
**Post date:** [7 January 2025 11:10 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/7 "2025-01-07T11:10:01Z")

</div>

It already works. Thank you

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [15 January 2025 21:29 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/8 "2025-01-15T21:29:05Z")

</div>

Thank you, for reviving this. I looked into it several years ago but sending images via the cellphone provider's Email to MMS gateway was easier and worked very well, and had the major benefit of not needing to install anything on my wife's phone and then having to teach her how to use it. Also was trivial to redirect the images to my neighbor when we went on vacation.

But a bit over a year ago FCC/FTC rules in the US caused all providers (as far as I can tell) to adopt "anti-spam" filters on the gateways. Some providers just turned off the gateways, most others bought a lame third party solution that blocks more than one message from the source in a three or four hour (or longer) interval. Sometimes message are delayed for a day or more! I send duplicates to the Gateway and my Gmail. It used to be a race that the MMS Gateway almost always won, now Gmail almost always wins and I can rarely get more than a couple of MMS messages a day to go through.

Trying to use Telegram is high on my todo list now, moreso since we have a vacation trip coming up in April.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 January 2025 21:34 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/9 "2025-01-15T21:34:57Z")

</div>

(Slight aside - if you just need to push an image (plus text of course) - then I find the Pushover app (and node) much easier to use than Telegram - If you need two way interaction then yes go with Telegram)

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [15 January 2025 22:06 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/10 "2025-01-15T22:06:08Z")

</div>

Thanks, I'll look into it!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 April 2025 22:06 UTC](https://discourse.nodered.org/t/telegram-how-to-send-an-image/94416/11 "2025-04-15T22:06:55Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
