diff options
author | ziro <palembani@gmail.com> | 2020-08-06 03:43:22 +0000 |
---|---|---|
committer | ziro <palembani@gmail.com> | 2020-08-06 03:43:22 +0000 |
commit | 0485c868c5a003a4047d472d41ae59e9e126bf3f (patch) | |
tree | a63bc0b6ae8e27df70acc6fc3ff450ed1f44a8b5 /cogs | |
parent | c2f9dda5d62463048361303b920162f1cfc0a5ba (diff) | |
download | steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar.gz steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar.bz2 steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar.lz steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar.xz steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.tar.zst steve-bot-0485c868c5a003a4047d472d41ae59e9e126bf3f.zip |
+ Added custom help command
Diffstat (limited to 'cogs')
-rw-r--r-- | cogs/help.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cogs/help.py b/cogs/help.py new file mode 100644 index 0000000..a69d5c2 --- /dev/null +++ b/cogs/help.py @@ -0,0 +1,34 @@ +from discord.ext import commands +import discord +import asyncio + +class Help(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def help(self, ctx): + """Show this message.""" + embed = discord.Embed( + title = "Help", + description = "Bot prefixes are \">\", and \"$>\"", + colour = discord.Colour.green() + ) + + cmds = list(self.bot.commands) + for cmd in cmds: + if cmd.hidden is True: + continue + if cmd.help is None: + _desc="No description." + else: + _desc=f"{cmd.help}" + _cmd = f"{str(cmd)}" + embed.add_field(name=f"{_cmd}", value=f"{_desc}", inline=False) + + + await ctx.send(embed=embed) + +def setup(bot): + bot.add_cog(Help(bot)) + |