# Node-red-contrib-telegrambot get last message

**URL:** <https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316>\
**Category:** General\
**Created:** [17 April 2021 11:08 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316 "2021-04-17T11:08:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hunter](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hunter/32/60045_2.png) [@Hunter](https://discourse.nodered.org/u/Hunter)\
**Post date:** [17 April 2021 11:08 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316/1 "2021-04-17T11:08:38Z")

</div>

Hello all,

Does this Telegram BOT allow to retrieve last message content, knowing the last message ID?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 April 2021 13:44 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316/2 "2021-04-17T13:44:45Z")

</div>

No. You need to retain it in your flow.

---

<div class="post-metadata">

**Author:** ![Hunter](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hunter/32/60045_2.png) [@Hunter](https://discourse.nodered.org/u/Hunter)\
**Post date:** [17 April 2021 14:08 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316/3 "2021-04-17T14:08:33Z")

</div>

Oke that is what I was afraid of. I'm doing that right now but I need this information for several users and am not sure how resources are affected if I need to retain all last messages for cases in which I need the message only in about 1 out of 100 cases.

What about editing a message, not sure how that works, can the message text be retrieved when editing? Does the message content need to be replaced entirely?

---

<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:** [17 April 2021 14:33 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316/4 "2021-04-17T14:33:16Z")

</div>

Storing 100 messages in flow or global context is trivial and will not impact anything at all tbh.

> [@Hunter](#):
>
> What about editing a message, not sure how that works, can the message text be retrieved when editing

I think you get another msg in node-red but it's easy to test and figure out.

Id probably use an array or lookup object to store last 100 messages. When you have a request to retrieve last message by message id, search array or lookup in object.

---

<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:** [16 June 2021 14:33 UTC](https://discourse.nodered.org/t/node-red-contrib-telegrambot-get-last-message/44316/5 "2021-06-16T14:33:32Z")

</div>

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