windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
256 stars 116 forks source link

how could I send unsent messages when the connection is back #300

Open Barabba11 opened 1 year ago

Barabba11 commented 1 year ago

Hi, there is any way to do it automatically, without loose any message sent? If not, any way to get the error message with the unsent message? So I can store it with node red and sent as the connection comes back. Thanks!

windkh commented 1 year ago

Hm I could

  1. buffer the messages
  2. or provide a second output,
  3. or I could add a property to the msg which is returned by the sender node

Would you prefer buffering the messages inside the flow on your own?

Barabba11 commented 1 year ago

Thank you for your kind reply and support :) Really good questions :) The smplest way may be add to the sender node options "try to send it again when internet appears", and add to the bot proprietes "store the last XX messages when internet unavailable", considering delete the oldest one if the quota has been reached, this may protect system from overflow.

If the second output is enabled to report errors, does it reports also when internet is disconnected and the message failed to be sent? I haven't tested it, this is welcome too.

Another interesting (but futile) option is to have extra output messages as "delivered" and "read", for the latest sent message

windkh commented 1 year ago

There is a control node that reports if the internet is not reachable.

Barabba11 commented 1 year ago

Hi mate, I hope you may consider this option, to store inside module some messages and send them as connection appears back. I have so many telegram sender on my flow that adding function to check connection, store and send back to sender's input gets complicated. Than you for understanding :)

derbmann commented 1 week ago

+1 for buffering the message in the sender node