Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
792 stars 343 forks source link

Failed to connect to api.telegram.org port 443 after 21043 ms: Timed out #301

Open pinkpanther551 opened 1 month ago

pinkpanther551 commented 1 month ago

Errors showing in project logs directory:

============[Date]============ [ 2024-05-29 17:09:33 Europe/Berlin ] ==========[Response]========== ok: False curl_error_code: 28 curl_error: Failed to connect to api.telegram.org port 443 after 21053 ms: Timed out =========[Sent Data]========== [ref] ref.chat_id= ref.text= AAAAAAAAAAAA

============[Trace]===========

0 C:\xampp\htdocs\AAAAAAAA\Telegram.php(1862): TelegramErrorLogger::log(Array, Array)

1 C:\xampp\htdocs\AAAAAAAA\Telegram.php(124): Telegram->sendAPIRequest('https://api.tel...', Array)

2 C:\xampp\htdocs\AAAAAAAA\Telegram.php(182): Telegram->endpoint('sendMessage', Array)

3 C:\xampp\htdocs\AAAAAAAA\index.php(10): Telegram->sendMessage(Array)

4 {main}

I use vpn to set webhooks and I receives all the requests in my NGrok panel with 200 status code. but after run my php code the warnings below are showing and the chat id doesnt receive in my script.

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\arshiranbot\Telegram.php on line 874

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\arshiranbot\Telegram.php on line 874

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\arshiranbot\Telegram.php on line 849

what is the solution?

EhsanShahbazii commented 1 week ago

Change your VPN or DNS settings in your network configuration. I had this problem when using Psiphon, but when I switched to BetterNet VPN, the issue was resolved.