mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-02 07:00:43 +00:00
Update proxy docs and warn if python-socks is not installed
As suggested in #4505.
This commit is contained in:
@@ -114,9 +114,6 @@ class InteractiveTelegramClient(TelegramClient):
|
||||
try:
|
||||
await self.connect()
|
||||
except IOError:
|
||||
# We handle IOError and not ConnectionError because
|
||||
# PySocks' errors do not subclass ConnectionError
|
||||
# (so this will work with and without proxies).
|
||||
print('Initial connection failed. Retrying...')
|
||||
await self.connect()
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ def get_env(name, message, cast=str):
|
||||
session = os.environ.get('TG_SESSION', 'printer')
|
||||
api_id = get_env('TG_API_ID', 'Enter your API ID: ', int)
|
||||
api_hash = get_env('TG_API_HASH', 'Enter your API hash: ')
|
||||
proxy = None # https://github.com/Anorov/PySocks
|
||||
proxy = None # https://github.com/romis2012/python-socks
|
||||
|
||||
# Create and start the client so we can make requests (we don't here)
|
||||
client = TelegramClient(session, api_id, api_hash, proxy=proxy).start()
|
||||
|
||||
@@ -27,7 +27,7 @@ def get_env(name, message, cast=str):
|
||||
session = os.environ.get('TG_SESSION', 'printer')
|
||||
api_id = get_env('TG_API_ID', 'Enter your API ID: ', int)
|
||||
api_hash = get_env('TG_API_HASH', 'Enter your API hash: ')
|
||||
proxy = None # https://github.com/Anorov/PySocks
|
||||
proxy = None # https://github.com/romis2012/python-socks
|
||||
|
||||
|
||||
# This is our update handler. It is called when a new update arrives.
|
||||
|
||||
Reference in New Issue
Block a user