diff --git a/cogs/commands.py b/cogs/commands.py index 18c526f..f7640dd 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -29,10 +29,8 @@ async def help_command(self, ctx, cog='all'): return color = ctx.channel.guild.me.color.value - help_embed = discord.Embed( - title=f'Help page of {self.bot.user}', - color=color - ) + help_embed = discord.Embed(color=color) + help_embed.set_footer( text=f'Requested by {ctx.message.author.name}', icon_url=ctx.message.author.avatar @@ -44,6 +42,9 @@ async def help_command(self, ctx, cog='all'): # If cog is not specified by the user, we list all cogs and commands if cog == 'all': + + help_embed.title = f"Help page of {self.bot.user}" + for cog in cogs: # Get a list of all commands under each cog @@ -74,7 +75,9 @@ async def help_command(self, ctx, cog='all'): if cog.lower() in lower_cogs: # Get a list of all commands in the specified cog - commands_list = self.bot.get_cog(cogs[lower_cogs.index(cog.lower())]).get_commands() + cog_object = self.bot.get_cog(cogs[lower_cogs.index(cog.lower())]) + help_embed.title = f"Help page for {cog.title()}" + commands_list = cog_object.get_commands() help_text = '' # Add details of each command to the help text @@ -91,8 +94,7 @@ async def help_command(self, ctx, cog='all'): help_text += f"Aliases: `{', '.join(command.aliases)}`\n" # Finally the format - help_text += f'Format: `@{self.bot.user.name}#{self.bot.user.discriminator}' \ - f' {command.name} {command.usage if command.usage is not None else ""}`\n\n' + help_text += f'Format: `{ctx.prefix}{command.name} {command.usage if command.usage is not None else ""}`\n\n' help_embed.description = help_text else: diff --git a/main.py b/main.py index 0094c42..945775e 100644 --- a/main.py +++ b/main.py @@ -16,6 +16,7 @@ # - managed channel adds new channel under last current existing # - managed channel checks for channels after start of bot # Changes +# - optimized help command: dynamic title, dynamic prefix # - moved to discord.py v2.x # - multiple reworks of afk management # - (error) logging optimization