From c13e9c3846b8653deadb5fe6bb8ae8701c52e5fe Mon Sep 17 00:00:00 2001 From: mango0x45 Date: Tue, 9 Jun 2020 23:56:01 +0200 Subject: Added listcommands() --- cogs/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cogs/utils.py b/cogs/utils.py index 27fd708..5492c14 100755 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -312,5 +312,15 @@ class Utils(commands.Cog): async def roll(self, ctx, pool): await ctx.send(f"You rolled a {randint(0, int(pool))}") + @commands.command(aliases=['commands', 'allcommands']) + async def listcommands(self, ctx): + with open('custom_commands.json', 'r') as f: + commands = json.load(f) + output = '```List of custom commands:\n' + for key in commands: + output += f'{key}, ' + output += '```' + await ctx.send(output) + def setup(bot): bot.add_cog(Utils(bot)) -- cgit v1.2.3