2020-03-21 14:53:40 +01:00
|
|
|
import discord
|
|
|
|
|
|
|
|
from modules.base import BaseClassPython
|
|
|
|
|
|
|
|
|
|
|
|
class MainClass(BaseClassPython):
|
|
|
|
name = "Aide"
|
|
|
|
help = {
|
|
|
|
"description": "Module d'aide",
|
|
|
|
"commands": {
|
|
|
|
"`{prefix}{command} list`": "Affiche une liste des modules ainsi qu'une desription",
|
|
|
|
"`{prefix}{command} <module>`": "Affiche l'aide sépcifique d'un module"# ,
|
|
|
|
# "`{prefix}{command} all`": "Affiche l'aide de tous les modules"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async def com_list(self, message, args, kwargs):
|
2020-04-05 13:09:16 +02:00
|
|
|
embed = discord.Embed(title="[Aide] - Liste des modules", color=self.config.color)
|
2020-03-21 14:53:40 +01:00
|
|
|
for moduleName in list(self.client.modules.keys()):
|
2020-04-05 13:17:36 +02:00
|
|
|
if self.client.modules[moduleName]["initialized_class"].config.help_active:
|
2020-03-21 14:53:40 +01:00
|
|
|
embed.add_field(
|
|
|
|
name=moduleName.capitalize(),
|
|
|
|
value=self.client.modules[moduleName]["initialized_class"].help["description"])
|
|
|
|
await message.channel.send(embed=embed)
|
|
|
|
|
|
|
|
# async def com_all(self, message, args, kwargs):
|
|
|
|
# for name, module in self.client.modules.items():
|
|
|
|
# await module["initialized_class"].send_help(message.channel)
|
|
|
|
|
|
|
|
async def command(self, message, args, kwargs):
|
2020-04-05 13:17:36 +02:00
|
|
|
if len(args) and args[0] in self.client.modules.keys() and self.client.modules[args[0]][
|
|
|
|
"initialized_class"].config.help_active:
|
2020-03-21 14:53:40 +01:00
|
|
|
await self.client.modules[args[0]]["initialized_class"].send_help(message.channel)
|
|
|
|
else :
|
|
|
|
await self.send_help(message.channel)
|