telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Random read operation timeouts

Open Chief-Alchemist opened this issue 2 years ago • 1 comments

I am running the bot locally (and interacting with it from the same machine) and unpredictably keep getting these errors, then no response from the bot for a very long time. Could not really find anything similar after researching for a bit.

2023/01/29 09:37:15 Error sending message: Post "https://api.telegram.org/{BOT}/sendMessage": read tcp :443: read: operation timed out

2023/01/29 09:37:15 Post "https://api.telegram.org/{BOT}/getUpdates": read tcp :443: read: operation timed out

Chief-Alchemist avatar Jan 29 '23 09:01 Chief-Alchemist

It's doesnt' matter if you run it's locally or not. If your bot working on polling model (according to your request it's true), your message cycle looks like:

your computer -> telegram server-> your computer

so it's still should be sent to the telegram server. If you want to obtain it - you should run your local TG server and use webhooks model.

The reason of your issue - timeout of sending messages, occurs cause of network issues. If you want to avoid it - you need more stable internet connection or set more democratic timeout

IvanDanilau avatar Sep 23 '23 18:09 IvanDanilau