# Telegram bot answer chatId

**URL:** <https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989>\
**Category:** General\
**Created:** [16 November 2020 08:04 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989 "2020-11-16T08:04:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorenzo](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lorenzo](https://discourse.nodered.org/u/Lorenzo)\
**Post date:** [16 November 2020 08:04 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989/1 "2020-11-16T08:04:04Z")

</div>

Good morning,  
I want to experiment the integration with a telegram bot.  
How do I respond to a specific chatId (of the received message) by inserting in msg.payload.content the content read from a file.  
In other words, how can I merge the input message with the content read from a file, so that I can reply to a chatId without knowing what it is.  
Thanks and greetings.  
Lorenzo

---

<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:** [16 November 2020 08:11 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989/2 "2020-11-16T08:11:27Z")

</div>

`msg.payload.chatId` should contain the chatId of the incoming message.

---

<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:** [16 November 2020 08:14 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989/3 "2020-11-16T08:14:43Z")

</div>

there is no need to join/merge, after the incoming message - pass the msg through a change node to move the current payload to something else (out of the way, e.g. msg.telegramPayload) & then through a `file in` to read the file then move the msg parts around to form your final payload before sending it back to telegram.

---

<div class="post-metadata">

**Author:** ![Lorenzo](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lorenzo](https://discourse.nodered.org/u/Lorenzo)\
**Post date:** [16 November 2020 08:34 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989/4 "2020-11-16T08:34:13Z")

</div>

Thank you very much.  
It works.  
Lorenzo

---

<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 January 2021 08:34 UTC](https://discourse.nodered.org/t/telegram-bot-answer-chatid/35989/5 "2021-01-15T08:34:21Z")

</div>

Closed on 15 January 2021 08:34 UTC

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