Commit
This commit is contained in:
parent
bc213e65f0
commit
f878bf87b1
@ -113,7 +113,7 @@ class MainClass(BaseClass):
|
|||||||
await message.channel.send(embed=embed)
|
await message.channel.send(embed=embed)
|
||||||
|
|
||||||
async def com_web_list(self, message, args, kwargs):
|
async def com_web_list(self, message, args, kwargs):
|
||||||
modules = self.api.list()
|
modules = await self.api.list()
|
||||||
text = ""
|
text = ""
|
||||||
for module, versions in modules.items():
|
for module, versions in modules.items():
|
||||||
text += module + " - " + ", ".join(versions)
|
text += module + " - " + ", ".join(versions)
|
||||||
|
@ -9,12 +9,14 @@ class Api:
|
|||||||
self.host = host
|
self.host = host
|
||||||
self.basepath = "http://"+host+"/api/current"
|
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 aiohttp.ClientSession() as session:
|
||||||
async with session.get(self.basepath+endpoint) as response:
|
async with session.get(self.basepath+endpoint) as response:
|
||||||
return await response.json()
|
return await response.json()
|
||||||
|
|
||||||
def _download(self, endpoint, filename="temp"):
|
async def _download(self, endpoint, filename="temp"):
|
||||||
if endpoint[0] != "/":
|
if endpoint[0] != "/":
|
||||||
endpoint = "/" + endpoint
|
endpoint = "/" + endpoint
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
|
Loading…
Reference in New Issue
Block a user