# Problem after updating Telegram bot

**URL:** <https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338>\
**Category:** General\
**Created:** [4 August 2021 17:21 UTC](https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338 "2021-08-04T17:21:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinglix](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pinglix](https://discourse.nodered.org/u/pinglix)\
**Post date:** [4 August 2021 17:21 UTC](https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338/1 "2021-08-04T17:21:30Z")

</div>

Hello,  
I updated telegram bot to10.0.4 and now I am not able to send pictures anymore with the sender object.  
Before the update it was working by reading a file from absolute path with filein block in single buffer mode then with a function block setting the properties of the telegram sender with:

msg.payload.chatId = msg.originalMessage.chat.id;  
msg.payload.type = "photo";  
msg.payload.content = msg.payload; \<-- this coming from FILEIN block

Now I get error ETELEGRAM: 400 Bad Request: message to copy not found when processing message.

Based on the documentation the type "photo" needs a value  
msg.payload.content = photo[index].file\_id  
but I don't understand what should I set nor what is the array photo[index].

Before I was passing the BLOB object from FILEIN but now this method seems no more available.

Hope the problem is clear.

Thank you.

---

<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:** [4 August 2021 20:34 UTC](https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338/2 "2021-08-04T20:34:22Z")

</div>

> [@pinglix](#):
>
> msg.payload.chatId = msg.originalMessage.chat.id;  
> msg.payload.type = "photo";  
> msg.payload.content = msg.payload; \<-- this coming from FILEIN block

I'd be surprised if that ever worked since the payload from the file node will be a buffer.

Try changing the logic around a bit to ensure payload is a regular object...

```auto
let filedata = msg.payload;
msg.payload = {};//create new empty object
msg.payload.chatId = msg.originalMessage.chat.id;
msg.payload.type = "photo";
msg.payload.content = filedata;

```

_(Untested, written on phone)_

---

<div class="post-metadata">

**Author:** ![pinglix](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pinglix](https://discourse.nodered.org/u/pinglix)\
**Post date:** [5 August 2021 19:05 UTC](https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338/3 "2021-08-05T19:05:31Z")

</div>

Hi Steve-Mcl,  
I tested your code and it works.  
Believe me before upgrading it was working passing directly the buffer from FILEIN as single object buffer. I don't know what telegram version was installed before.

Now the telegram sender sent me the picture and gave me 4 messages about "Failure (Bad values)" on the second output as errors but I received the picture on my chat.  
I don't know how to make further tests but it works again.

Thank you

---

<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:** [19 August 2021 19:05 UTC](https://discourse.nodered.org/t/problem-after-updating-telegram-bot/49338/4 "2021-08-19T19:05:38Z")

</div>

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