diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index f35628a9..45aa4d6a 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1529,7 +1529,7 @@ class Client(Methods, BaseClient): count = 0 if not include: - for path in sorted(Path(root).rglob("*.py")): + for path in sorted(Path(root.replace(".", "/")).rglob("*.py")): module_path = '.'.join(path.parent.parts + (path.stem,)) module = reload(import_module(module_path)) @@ -1591,7 +1591,7 @@ class Client(Methods, BaseClient): warn_non_existent_functions = True try: - module = reload(import_module(module_path)) + module = import_module(module_path) except ImportError: log.warning('[{}] [UNLOAD] Ignoring non-existent module "{}"'.format( self.session_name, module_path))