From 7cac3668d6ad99db7fe08d23a023535edd2429cb Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 20 Sep 2022 12:59:36 +0200 Subject: [PATCH] Make custom, functions and types proper modules This allows "from telethon.types import Message" to work. Closes #3929. Not entirely sure how it used to work before, perhaps it got changed at some point but this should revert previous behaviour. --- telethon/__init__.py | 3 +-- telethon/custom.py | 1 + telethon/functions.py | 1 + telethon/types.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 telethon/custom.py create mode 100644 telethon/functions.py create mode 100644 telethon/types.py diff --git a/telethon/__init__.py b/telethon/__init__.py index 3a62f1c8..c3334d7c 100644 --- a/telethon/__init__.py +++ b/telethon/__init__.py @@ -1,9 +1,8 @@ from .client.telegramclient import TelegramClient from .network import connection -from .tl import types, functions, custom from .tl.custom import Button from .tl import patched as _ # import for its side-effects -from . import version, events, utils, errors +from . import version, events, utils, errors, types, functions, custom __version__ = version.__version__ diff --git a/telethon/custom.py b/telethon/custom.py new file mode 100644 index 00000000..da28dd0a --- /dev/null +++ b/telethon/custom.py @@ -0,0 +1 @@ +from .tl.custom import * diff --git a/telethon/functions.py b/telethon/functions.py new file mode 100644 index 00000000..7cbde3ba --- /dev/null +++ b/telethon/functions.py @@ -0,0 +1 @@ +from .tl.functions import * diff --git a/telethon/types.py b/telethon/types.py new file mode 100644 index 00000000..129f6125 --- /dev/null +++ b/telethon/types.py @@ -0,0 +1 @@ +from .tl.types import *