diff --git a/DMBotNetwork/client.py b/DMBotNetwork/client.py index d04a4eb..601be58 100644 --- a/DMBotNetwork/client.py +++ b/DMBotNetwork/client.py @@ -260,8 +260,10 @@ async def _download_file(self, server_data: dict) -> None: if not file_name: return - file_path: Path = self._server_file_path / self._cur_server_name / file_name - file_path.mkdir(parents=True, exist_ok=True) + dir_path = self._server_file_path / self._cur_server_name + dir_path.mkdir(parents=True, exist_ok=True) + file_path = dir_path / file_name + with open(file_path, "wb") as file: received_size = 0 diff --git a/DMBotNetwork/server.py b/DMBotNetwork/server.py index d022828..14d6871 100644 --- a/DMBotNetwork/server.py +++ b/DMBotNetwork/server.py @@ -400,8 +400,7 @@ async def send_data_login(self, login: str, data: Any) -> None: await self.send_data(self._connects[login], data) - - async def send_data_login(self, login: str, path: Path, file_name: str) -> None: + async def send_file_login(self, login: str, path: Path, file_name: str) -> None: if login not in self._connects: raise ValueError("Unknown login")