F33RNI / GPT-Telegramus

💜 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!
GNU Affero General Public License v3.0
320 stars 101 forks source link

Add proxy option for Telegram. #141

Closed Aqaao closed 2 months ago

Aqaao commented 4 months ago

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

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()
F33RNI commented 3 months ago

https://github.com/F33RNI/GPT-Telegramus/pull/160

F33RNI commented 3 months ago

Can u please check?

Aqaao commented 2 months ago

160

It work well. thank you😘.