from discord.ext import commands from libs.Cog import Cog class Commands(Cog): def __init__(self, bot): super().__init__(bot) self.messages_deletable = True @commands.command() async def commands(self, ctx): current_cmds = [] for cog in self.bot.cogs: if cog != "Commands": cg = self.bot.get_cog(cog) cmds = cg.get_commands() current_cmds.append(f"/{c.name} - {c.description}" for c in cmds) await ctx.author.send("\n".join(current_cmds)) await self.delete_message(ctx.message) async def setup(bot): await bot.add_cog(Commands(bot))