Une autre partie

This commit is contained in:
fomys 2019-05-09 01:39:33 +02:00
parent 9a1e95cd5a
commit bc213e65f0
3 changed files with 13 additions and 3 deletions

5
.gitignore vendored
View File

@ -63,3 +63,8 @@ target/
.*.kate-swp
.swp.*
temp.zip
storage/*
config/*
.idea/*

View File

@ -3,7 +3,7 @@ import os
import discord
from modules.base import BaseClass
from modules.modules.api import Api
class MainClass(BaseClass):
@ -25,6 +25,7 @@ class MainClass(BaseClass):
def __init__(self, client):
super().__init__(client)
self.storage.mkdir("modules")
self.api = Api()
def get_all_modules(self):
all_items = os.listdir("modules")
@ -112,4 +113,8 @@ class MainClass(BaseClass):
await message.channel.send(embed=embed)
async def com_web_list(self, message, args, kwargs):
pass
modules = self.api.list()
text = ""
for module, versions in modules.items():
text += module + " - " + ", ".join(versions)
await message.channel.send(text)

View File

@ -5,7 +5,7 @@ import aiofiles
import zipfile
class Api:
def __init__(self, host):
def __init__(self, host="localhost:8000"):
self.host = host
self.basepath = "http://"+host+"/api/current"