From 2f62843136076041fde9d2cb00cafb692f962aeb Mon Sep 17 00:00:00 2001 From: fomys Date: Thu, 9 May 2019 01:48:53 +0200 Subject: [PATCH] CA MARCHE --- modules/modules/__init__.py | 3 +++ modules/modules/api.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/modules/__init__.py b/modules/modules/__init__.py index 2661335..ff4d739 100644 --- a/modules/modules/__init__.py +++ b/modules/modules/__init__.py @@ -118,3 +118,6 @@ class MainClass(BaseClass): for module, versions in modules.items(): text += module + " - " + ", ".join(versions) await message.channel.send(text) + + async def com_web_dl(self, message, args, kwargs): + await self.api.download(args[1], args[2]) diff --git a/modules/modules/api.py b/modules/modules/api.py index 4943cd2..8d0d589 100644 --- a/modules/modules/api.py +++ b/modules/modules/api.py @@ -30,5 +30,5 @@ class Api: async def download(self, module, version): await self._download("modules/"+module+"/"+version, filename="temp.zip") - with zipfile.ZipFile('test.zip', "r") as z: + with zipfile.ZipFile('temp.zip', "r") as z: z.extractall(os.path.join("modules", module))