client
from datetime import datetime
def get_client():
last_dt = datetime.now()
last_proxy = rand_proxy()
while True:
if (datetime.now() - last_dt).seconds > 30:
last_proxy = rand_proxy()
last_dt = datetime.now()
yield httpx.AsyncClient(proxies=last_proxy)
from telebot import apihelper
apihelper.proxy = {'https' :'127.0.0.1:9150'}