diff --git a/modules/modules/__init__.py b/modules/modules/__init__.py index d1a99f6..2661335 100644 --- a/modules/modules/__init__.py +++ b/modules/modules/__init__.py @@ -113,7 +113,7 @@ class MainClass(BaseClass): await message.channel.send(embed=embed) async def com_web_list(self, message, args, kwargs): - modules = self.api.list() + modules = await self.api.list() text = "" for module, versions in modules.items(): text += module + " - " + ", ".join(versions) diff --git a/modules/modules/api.py b/modules/modules/api.py index af30000..4943cd2 100644 --- a/modules/modules/api.py +++ b/modules/modules/api.py @@ -9,12 +9,14 @@ class Api: self.host = host self.basepath = "http://"+host+"/api/current" - def _get(self, endpoint): + async def _get(self, endpoint): + if endpoint[0] != "/": + endpoint = "/" + endpoint async with aiohttp.ClientSession() as session: async with session.get(self.basepath+endpoint) as response: return await response.json() - def _download(self, endpoint, filename="temp"): + async def _download(self, endpoint, filename="temp"): if endpoint[0] != "/": endpoint = "/" + endpoint async with aiohttp.ClientSession() as session: