-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Please answer these questions before submitting your issue. Thanks!
- What version of pyTelegramBotAPI are you using?
4.16.1
- What OS are you using?
Linux Mint
- What version of python are you using?
3.10.12
Issue: When I try to use polling() I get a timeout error from requests library.
Steps I took to isolate the issue:
-
Test outside Python
I tested the API endpoint using a curl tool and I was successful in getting responses from the getme and getupdates endpoint when using the same URL that pyTelegramBotAPI uses. -
Test requests
I tested the Python requests library with a different URL and received a quick 200 response. -
Test requests with bot URL
I tested the Python requests library with the same URL that pyTelegramBotAPI uses and there was no response. Implemented a 10 second timeout throws the timeout error as expected. -
Test requests with Telegram API
I tested the Python request library using the get method to connect to 'https://api.telegram.org/', again no response.
It would appear that the requests library cannot connect to the Telegram bot API.
When enabling debug I get the following:
2024-02-26 10:16:17,005 (apihelper.py:87 MainThread) DEBUG - TeleBot: "Request: method=get url=https://api.telegram.org/botXXXXXXX:{TOKEN}/getMe params=None files=None"
XXXXXXX being the first section before the colon of my api token, edited for privacy.