aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziro <palembani@gmail.com>2020-08-06 06:48:02 +0000
committerziro <palembani@gmail.com>2020-08-06 06:48:02 +0000
commitf797397950a1757a978962e912edae1a7263d3cb (patch)
treeafa6c6bf6c0b243952fe587937cf9deb09eb4742
parent7a494e6c90385a3c7785ce9ff2c276a6d856ea6a (diff)
downloadsteve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar.gz
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar.bz2
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar.lz
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar.xz
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.tar.zst
steve-bot-f797397950a1757a978962e912edae1a7263d3cb.zip
+ Added listcommands to help.py (from mcbeDiscordBot)
>Fixed the trailing comma from listcommands
-rw-r--r--cogs/help.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/cogs/help.py b/cogs/help.py
index dafe6c5..7fb1b9f 100644
--- a/cogs/help.py
+++ b/cogs/help.py
@@ -1,6 +1,7 @@
from discord.ext import commands
import discord
import asyncio
+import json
class Help(commands.Cog):
def __init__(self, bot):
@@ -28,6 +29,21 @@ class Help(commands.Cog):
await ctx.send(embed=embed)
+ @commands.command(aliases=['customcommands', 'ccmds'])
+ async def listcommands(self, ctx):
+ """List all custom commands"""
+ embed = discord.Embed(
+ title = "Help",
+ colour = discord.Colour.gold()
+ )
+ with open('custom_commands.json', 'r') as f:
+ commands = json.load(f)
+ ccmds = ", ".join([*commands])
+ # await ctx.send(f"```List of custom commands: \n{ccmds}```")
+ # output += f'{ccmds}```'
+ embed.add_field(name="Custom Commands", value=f"{ccmds}", inline=False)
+ await ctx.send(embed=embed)
+
def setup(bot):
bot.add_cog(Help(bot))