💜 The best free Telegram bot for ChatGPT, Microsoft Copilot (aka Bing AI / Sidney / EdgeGPT), Microsoft Copilot Designer (aka BingImageCreator), Gemini and Groq with stream writing, requests with images, multiple languages, admin control, data logging and more!
from telegram.ext import ApplicationBuilder
# "USERNAME:PASSWORD@" is optional, if you need authentication:
proxy_url = 'http://USERNAME:PASSWORD@PROXY_HOST:PROXY_PORT' # can also be a https proxy
app = ApplicationBuilder().token("TOKEN").proxy(proxy_url).get_updates_proxy(proxy_url).build()
Implementing this is simple. The following is the document of python-telegram-bot. Just load proxy url from
config.json
or environment variables. https://github.com/python-telegram-bot/python-telegram-bot/wiki/Working-Behind-a-Proxy