Here is my simple code. I am trying to connect telegram api with my newly created bot.
SOCKS_URL = 'socks5://77.247.94.153:8888/'
SOCKS_USER = ''
SOCKS_PASS = ''
bot = Bot(
'TOKEN',
request=Request(
proxy_url=SOCKS_URL,
urllib3_proxy_kwargs={
'username': SOCKS_USER,
'password': SOCKS_PASS,
},
)
)
print(str(bot.get_me().id))
but its always replies
Max retries exceeded with url: /botTOKEN/getMe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
I am able get result using postman but not able to get response using requests. enter image description here
https://i.stack.imgur.com/Fv40Z.png
import requests
url = "https://api.telegram.org/botTOKEN/getMe"
response = requests.request("GET", url)
print(response.text)
anyone has idea then help me Thanks
Here is my simple code. I am trying to connect telegram api with my newly created bot.
but its always replies
Max retries exceeded with url: /botTOKEN/getMe (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
I am able get result using postman but not able to get response using requests. enter image description here
https://i.stack.imgur.com/Fv40Z.png
import requests
anyone has idea then help me Thanks