Telegrambot not working

can you share the settings you are using in the bot config node please (with the botname and token obscured of course).

Also, is the new device on a different network to the old?

Yes, it is.

That is the next thing to check then. What might be blocking the traffic?

1 Like

I have now installed the test flow on a different system in the same network as the not working system and it is working well. So it seems not to be depending on the network.

Does the different system use the same Hardware/OS/Software combination?

To me, this suggests a problem with the particular installation you are having a problem with. Your flow ran on my Pi4 Node-RED system here here with no problem once I had entered the correct credentials for Telegrambot. Possibly Rebuild from scratch the 'faulty' system if you can find no network errors?

And check for things like local proxies or local firewalls that might have got installed or configured on that one device.

There is only Debian and Node Red installed on that system. No local proxies or firewalls and no network errors.
I will configure a second new system from scratch to see if it has the same problem.

BTW, it's really easy to drive the Telegram Bot API using a regular HTTP Request node.
This might be an easy route to solve this problem.

Set up the call like this

msg.payload = {
    "text":msg.payload,
    "chat_id": "xxxx"
}
    
msg.url = "https://api.telegram.org/bot" +
    "yyyy" +
    "/sendMessage"
    
return msg;

Then feed it into an HTTP POST.

I'm not sure that is the problem though. It works on other devices, just not that specific device.

Many thanks. That works very well. The messages are sent as expected.
The problem seems to be indeed with the telegram bot node.

As I only need to send messages, this solves my problem.

2 Likes

Glad it is working, a shame the error has not been identified. It does seem strange when the node works on other systems correctly.

I am not sure how using the HTTP request call functions vs. Telegrambot, unless there is some kind of change in ports. But then I am getting way way outside my comfort zone!! :laughing:

That's great to hear.
I also receive messages from the bot through an HTTP input node (you have to register a web hook with the Telegram bot as a one-off operation), and of course that has to be internet-facing.
I host a tiny stub in the cloud which receives the HTTP call from Telegram, acks it (HTTP response node) and then MQTTs it down to my house for processing by my bot application.

The nice thing is you don't have to reply synchronously - you just post back an answer if and when you feel like it, so it's a lot easier than things like Alexa skills which need your reply in the HTTP response.

One day I'll shift from polling to web hook for my Telegram bots. Just never seem to get the time to set it up securely. When I do, it will be on my local server (I have a fixed IP at home which makes it easier), fronted by NGINX and my home (Ubiquity) router as the first lines of security with access only allowed via CloudFlare which will be the 2nd line of defence.

I have completely rebuilt the system and now the Telegram Node works too.

1 Like

Great news, even if a little frustrating to have to do it!!

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