rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.8k stars 1.23k forks source link

Why does my code keep reporting this error? #1361

Closed freeoptions closed 5 months ago

freeoptions commented 6 months ago

Why does my code keep reporting this error?

image_2024-05-20_17-57-42

2024-05-15 19:55:29.394 ERROR 426 --- [gram Connection] o.t.t.u.DefaultBotSession: api.telegram.org:443 failed to respond org.apache.http.NoHttpResponseException: api.telegram.org:443 failed to respond

Below is my code

image_2024-05-20_17-58-54 image_2024-05-20_18-01-27

I just want to use Java to send some messages to Telegram regularly. Although it does not affect the use, the program will keep reporting errors, which makes me very unhappy. How should I solve it? Please help me solve my doubts, thank you!

Chase22 commented 6 months ago

Is this happening constantly or occasionally?

You should make sure to run on the newest version. We have switch over to using OkHttp to send requests.

This might also be caused by the goverment blocking connections to telegram.org.

freeoptions commented 6 months ago

Is this happening constantly or occasionally? It's not accidental, it's always reporting this error

You should make sure to run on the newest version. We have switch over to using OkHttp to send requests. The version I am using is 6.1.0. Following your suggestion, I changed to 6.9.7.1 image

This might also be caused by the goverment blocking connections to telegram.org. Maybe it was intercepted by the government, but I'm not sure.

thank you~

Chase22 commented 6 months ago

The current version is 7.2. Checkout the docs on how to update: https://rubenlagus.github.io/TelegramBotsDocumentation/how-to-update.html#to-version-7-0-0

freeoptions commented 6 months ago

The current version is 7.2. Checkout the docs on how to update: https://rubenlagus.github.io/TelegramBotsDocumentation/how-to-update.html#to-version-7-0-0

Oh, are you talking about Telegram Bots Meta? The latest version of Telegram Bots Meta is indeed 7.2.1. I am currently using the latest version of Telegram Bots 6.9.7.1. Then I will try version 7.2.1 of Telegram Bots Meta first. Thank you.

image

Chase22 commented 6 months ago

No. I'm talking about the whole library. It is split into multiple modules now. The teleframbots dependency is deprecated

freeoptions commented 6 months ago

No. I'm talking about the whole library. It is split into multiple modules now. The teleframbots dependency is deprecated

So the latest dependency is Telegram Bots Meta 7.2.1? It seems that I need to change the Telegram Bots dependency to Telegram Bots Meta.

thank you!