help for a command

This commit is contained in:
ddorn 2020-04-29 01:57:14 +02:00
parent 463be1691d
commit f55084e33e
1 changed files with 29 additions and 13 deletions

View File

@ -53,20 +53,8 @@ class MiscCog(Cog, name="Divers"):
if not args: if not args:
await self.send_bot_help(ctx) await self.send_bot_help(ctx)
return
else: else:
pass await self.send_command_help(ctx, args)
embed = discord.Embed(
title="Help for `!draw`",
description="Groupe qui continent des commande pour les tirages",
color=0xFFA500,
)
# embed.set_author(name="*oooo*")
embed.add_field(name="zoulou", value="okokok", inline=True)
embed.add_field(name="lklk", value="mnmn", inline=True)
embed.set_footer(text="thankss!")
await ctx.send(embed=embed)
async def send_bot_help(self, ctx: Context): async def send_bot_help(self, ctx: Context):
embed = discord.Embed( embed = discord.Embed(
@ -107,6 +95,34 @@ class MiscCog(Cog, name="Divers"):
await ctx.send(embed=embed) await ctx.send(embed=embed)
async def send_command_help(self, ctx, args):
name = " ".join(args)
comm: Command = self.bot.get_command(name)
if comm is None:
await ctx.send(
f"La commande `!{name}` n'existe pas. "
f"Utilise `!help` pour une liste des commandes."
)
return
embed = discord.Embed(
title=f"Aide pour la commande `!{comm.qualified_name}`",
description=comm.help,
color=0xFFA500,
)
# embed.set_author(name="*oooo*")
if comm.aliases:
aliases = ", ".join(f"`{a}`" for a in comm.aliases)
embed.add_field(name="Alias", value=aliases, inline=True)
if comm.signature:
embed.add_field(
name="Usage", value=f"`!{comm.qualified_name} {comm.signature}`"
)
embed.set_footer(text="Suggestion ? Problème ? Envoie un message à @Diego")
await ctx.send(embed=embed)
def _name(self, command: Command): def _name(self, command: Command):
return f"`!{command.qualified_name}`" return f"`!{command.qualified_name}`"