# My first use of telegram bot

**URL:** <https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592>\
**Category:** General\
**Created:** [1 February 2022 12:43 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592 "2022-02-01T12:43:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![x\_dadu](https://avatars.discourse-cdn.com/v4/letter/x/47e85d/32.png) [@x\_dadu](https://discourse.nodered.org/u/x_dadu)\
**Post date:** [1 February 2022 12:43 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/1 "2022-02-01T12:43:33Z")

</div>

I'm trying to send messages from node-red. I installed and configured the telegram according to the instructions here [Send messages using Telegram and Node-RED – IoT with us](https://www.iotwithus.com/send-messages-using-telegram-and-node-red/)  
When executed, it send the message "hello from node-red!" as expected, but i don't know how to change function node to send a message received from inject node.  
The original function node content is:

```auto
msg.payload = {}
msg.payload.chatId = your-id-here
msg.payload.type = ‘message’
msg.payload.content = ‘hello from node-red!’
return msg;

```

---

<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:** [1 February 2022 12:51 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/2 "2022-02-01T12:51:51Z")

</div>

```auto
let message = msg.payload;
msg.payload = {}
msg.payload.chatId = your-id-here
msg.payload.type = ‘message’
msg.payload.content = message
return msg;

```

assuming your inject is inputting msg.payload and is a string with your message.

---

<div class="post-metadata">

**Author:** ![x\_dadu](https://avatars.discourse-cdn.com/v4/letter/x/47e85d/32.png) [@x\_dadu](https://discourse.nodered.org/u/x_dadu)\
**Post date:** [1 February 2022 12:58 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/3 "2022-02-01T12:58:27Z")

</div>

unfortunately I can't test because I broke my flow :)) I don't know what I did to them, but I can't work at all, I cleaned up some empty flows and now I have an error when I deploy:  
Flows stopped due to missing node types.  
telegrambot-config

but nothing is missing from my flow

---

<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:** [1 February 2022 13:03 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/4 "2022-02-01T13:03:05Z")

</div>

go to config in sidebar hit unused, delete all unused configs by highlighting them, then pressing delete on keyboard, then redeploy

 ![Screenshot_20220201-130350](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2dd06b306a06ae5b3a0ce44053d087d3081fd96.png)

---

<div class="post-metadata">

**Author:** ![x\_dadu](https://avatars.discourse-cdn.com/v4/letter/x/47e85d/32.png) [@x\_dadu](https://discourse.nodered.org/u/x_dadu)\
**Post date:** [1 February 2022 13:08 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/5 "2022-02-01T13:08:52Z")

</div>

that was the problem, there was many unused nodes, now telegram send the message I want, thank you very much

---

<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 February 2022 13:08 UTC](https://discourse.nodered.org/t/my-first-use-of-telegram-bot/57592/6 "2022-02-15T13:08:56Z")

</div>

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