# Telegram send, semantic issue?

**URL:** https://discourse.nodered.org/t/telegram-send-semantic-issue/45142
**Category:** General
**Created:** [3 May 2021 20:02 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142 "2021-05-03T20:02:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Chura](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chura/32/32051_2.png) [@Chura](https://discourse.nodered.org/u/Chura)
#### Post date: [3 May 2021 20:02 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/1 "2021-05-03T20:02:04Z")

</div>

Hi,

I've been using this to send telegram images from buffer for years  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/4032c9ec75d866e670a49eebe2ff74b8126c1df7.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1c73cc35db9b0cc0cb0ade80d6d464ade14bbc23.png)

in the last few days, I can't send this specific msgs, getting this error  
Caught exception in sender node:  
Error: ETELEGRAM: 400 Bad Request: message to copy not found  
when processing message:

I tried anything I could think of, nothing worked.  
So I just copied a different format that actually doing the very same

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13cfbf3c2951ebb49e31eb8bcd877d480bd3c04b.png)  
\*\* caption is added as well, just took screenshot before.

and now I'm sending successfully. What the hell is going on ? its exactly the same fields eventually. no ?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [3 May 2021 22:01 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/2 "2021-05-03T22:01:33Z")

</div>

Look at your function code. Why are you setting msg.payload.content to msg.payload?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [4 May 2021 07:54 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/3 "2021-05-04T07:54:10Z")

</div>

> [@Chura](#):
>
> its exactly the same fields eventually. no

No, feed the first function into a debug node and expand the payload and see what you have in `msg.payload.content`. You will find it is a circular reference. The reason is that when you say `msg.payload.content = msg.payload` you are saying set the content property of the payload to contain a reference to the original payload, so the result is that msg.payload.content is a reference to msg.payload, which contains a property content which is a reference to msg.payload which contains a property content which ...

When you use the second format the result is that it makes an object containing the properties chatID, photo and content, where again content is a reference to the original payload. However, because the statement is overwriting the whole of msg.payload it will make a new object for msg.payload to be a reference to. The original msg.payload still has msg.payload.content refering to it so it is not deleted but remains in existence for msg.payload.content to refer to.

---

<div class="post-metadata">

### Author: ![Chura](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chura/32/32051_2.png) [@Chura](https://discourse.nodered.org/u/Chura)
#### Post date: [4 May 2021 09:18 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/4 "2021-05-04T09:18:27Z")

</div>

Thanks both. I wonder how it worked from first place for ages.  
"Get Picture" gets a image from URL and write it to buffer, that buffer is msg.payload.  
Should I just add "change" and move msg.payload to msg.payload.content or I can do this smarter in the formula ?

---

<div class="post-metadata">

### Author: ![Chura](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chura/32/32051_2.png) [@Chura](https://discourse.nodered.org/u/Chura)
#### Post date: [4 May 2021 09:43 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/5 "2021-05-04T09:43:35Z")

</div>

Did it the other way around, not sure why I didn't do that from first place 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/249d6ac1add43efdf6af12892844cb0bd48399e0.png)

---

<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: [18 May 2021 09:44 UTC](https://discourse.nodered.org/t/telegram-send-semantic-issue/45142/6 "2021-05-18T09:44:25Z")

</div>

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