mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Merge pull request #33 from belegnar/master
Doc improvement and force reconnection
This commit is contained in:
commit
6b1dc30045
|
@ -56,7 +56,7 @@ Installing Telethon manually
|
|||
(`GitHub <https://github.com/ricmoo/pyaes>`_, `package index <https://pypi.python.org/pypi/pyaes>`_)
|
||||
2. Clone Telethon's GitHub repository: ``git clone https://github.com/LonamiWebs/Telethon.git``
|
||||
3. Enter the cloned repository: ``cd Telethon``
|
||||
4. Run the code generator: ``python3 telethon_generator/tl_generator.py``
|
||||
4. Run the code generator: ``cd telethon_generator && python3 tl_generator.py``
|
||||
5. Done!
|
||||
|
||||
Running Telethon
|
||||
|
|
|
@ -90,7 +90,7 @@ class TelegramClient:
|
|||
Note that authenticating to the Telegram servers is not the same as authenticating
|
||||
the app, which requires to send a code first."""
|
||||
try:
|
||||
if not self.session.auth_key or reconnect:
|
||||
if not self.session.auth_key or (reconnect and self.sender is not None):
|
||||
self.session.auth_key, self.session.time_offset = \
|
||||
authenticator.do_authentication(self.transport)
|
||||
|
||||
|
@ -146,6 +146,7 @@ class TelegramClient:
|
|||
"""Disconnects from the Telegram server **and pauses all the spawned threads**"""
|
||||
if self.sender:
|
||||
self.sender.disconnect()
|
||||
self.sender = None
|
||||
|
||||
# endregion
|
||||
|
||||
|
|
|
@ -2,7 +2,10 @@ import os
|
|||
import re
|
||||
import shutil
|
||||
|
||||
from .parser import SourceBuilder, TLParser
|
||||
try:
|
||||
from .parser import SourceBuilder, TLParser
|
||||
except (ImportError, SystemError):
|
||||
from parser import SourceBuilder, TLParser
|
||||
|
||||
|
||||
def get_output_path(normal_path):
|
||||
|
|
Loading…
Reference in New Issue
Block a user