From 9b959373dbf74c702ce20fd3e76d57e510c50043 Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sun, 1 May 2022 18:43:07 +0500 Subject: [PATCH 1/2] Fixed proxy for asynctelebot --- telebot/asyncio_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index be6223b..dde8c85 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -60,7 +60,7 @@ async def _process_request(token, url, method='get', params=None, files=None, re while not got_result and current_try Date: Sun, 1 May 2022 19:13:49 +0500 Subject: [PATCH 2/2] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index a0e283f..3412d80 100644 --- a/README.md +++ b/README.md @@ -656,6 +656,8 @@ telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console. ``` ### Proxy +For sync: + You can use proxy for request. `apihelper.proxy` object will use by call `requests` proxies argument. ```python @@ -670,6 +672,14 @@ If you want to use socket5 proxy you need install dependency `pip install reques apihelper.proxy = {'https':'socks5://userproxy:password@proxy_address:port'} ``` +For async: +```python +from telebot import asyncio_helper + +asyncio_helper.proxy = 'http://127.0.0.1:3128' #url +``` + + ### Testing You can disable or change the interaction with real Telegram server by using ```python