Update Telethon version
This commit is contained in:
@@ -42,7 +42,7 @@ class AbstractUser:
|
||||
self.tgid = None
|
||||
self.mxid = None
|
||||
|
||||
def _init_client(self):
|
||||
async def _init_client(self):
|
||||
self.log.debug(f"Initializing client for {self.name}")
|
||||
device = f"{platform.system()} {platform.release()}"
|
||||
sysversion = MautrixTelegramClient.__version__
|
||||
@@ -53,7 +53,7 @@ class AbstractUser:
|
||||
app_version=__version__,
|
||||
system_version=sysversion,
|
||||
device_model=device)
|
||||
self.client.add_update_handler(self._update_catch)
|
||||
await self.client.add_event_handler(self._update_catch)
|
||||
|
||||
async def update(self, update):
|
||||
return False
|
||||
@@ -89,7 +89,7 @@ class AbstractUser:
|
||||
|
||||
async def start(self):
|
||||
if not self.client:
|
||||
self._init_client()
|
||||
await self._init_client()
|
||||
self.connected = await self.client.connect()
|
||||
|
||||
async def ensure_started(self, even_if_no_session=False):
|
||||
|
||||
@@ -38,7 +38,6 @@ class Bot(AbstractUser):
|
||||
self.token = token
|
||||
self.whitelisted = True
|
||||
self.username = None
|
||||
self._init_client()
|
||||
self.chats = {chat.id: chat.type for chat in BotChat.query.all()}
|
||||
|
||||
async def start(self):
|
||||
|
||||
@@ -74,6 +74,7 @@ async def transfer_file_to_matrix(db, client, intent, location):
|
||||
db.add(db_file)
|
||||
db.commit()
|
||||
except IntegrityError:
|
||||
db.rollback()
|
||||
log.exception("Integrity error while saving transferred file data. "
|
||||
"This was probably caused by two simultaneous transfers of the same file, "
|
||||
"and should not cause any problems.")
|
||||
|
||||
@@ -6,3 +6,4 @@ alembic
|
||||
Markdown
|
||||
Pillow
|
||||
future-fstrings
|
||||
cryptg
|
||||
|
||||
@@ -25,11 +25,12 @@ setuptools.setup(
|
||||
"Pillow>=5.0.0,<6",
|
||||
"future-fstrings>=0.4.2",
|
||||
"python-magic>=0.4.15,<0.5",
|
||||
"cryptg>=0.1,<0.2",
|
||||
],
|
||||
dependency_links=[
|
||||
("https://github.com/LonamiWebs/Telethon/tarball/7998fd59f709ae1cd959c5cc4ab107982307f4a6#egg=Telethon"
|
||||
("https://github.com/LonamiWebs/Telethon/tarball/731a2956df632b10ecbbaf615cdf5eee49a4dc89#egg=Telethon"
|
||||
if sys.version_info >= (3, 6)
|
||||
else "https://github.com/tulir/Telethon/tarball/ca08fe28800d74fd6c19fd6f473e12fbf2c258de#egg=Telethon")
|
||||
else "https://github.com/tulir/Telethon/tarball/b050a5360a6b465943505d6ab9fdec6f96acb8b4#egg=Telethon")
|
||||
],
|
||||
|
||||
classifiers=[
|
||||
|
||||
Reference in New Issue
Block a user