Created
August 28, 2019 16:03
-
-
Save That-Kidd/432b028352a44e434dfd54e3676a6a85 to your computer and use it in GitHub Desktop.
A kinda advanced custom "help" command for your Discord.py Rewrite bots!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This custom help command is a perfect replacement for the default one on any Discord Bot written in Discord.py Rewrite! | |
However, you must put "bot.remove_command('help')" in your bot, and the command must be in a cog for it to work. | |
Written by Jared Newsom (AKA Jared M.F.)!""" | |
@commands.command() | |
commands.has_permissions(add_reactions=True,embed_links=True) | |
async def help(self,ctx,*cog): | |
"""Gets all cogs and commands of mine.""" | |
try: | |
if not cog: | |
halp=discord.Embed(title='Cog Listing and Uncatergorized Commands', | |
description='Use `!help *cog*` to find out more about them!\n(BTW, the Cog Name Must Be in Title Case, Just Like this Sentence.)') | |
cogs_desc = '' | |
for x in self.bot.cogs: | |
cogs_desc += ('{} - {}'.format(x,self.bot.cogs[x].__doc__)+'\n') | |
halp.add_field(name='Cogs',value=cogs_desc[0:len(cogs_desc)-1],inline=False) | |
cmds_desc = '' | |
for y in self.bot.walk_commands(): | |
if not y.cog_name and not y.hidden: | |
cmds_desc += ('{} - {}'.format(y.name,y.help)+'\n') | |
halp.add_field(name='Uncatergorized Commands',value=cmds_desc[0:len(cmds_desc)-1],inline=False) | |
await ctx.message.add_reaction(emoji='✉') | |
await ctx.message.author.send('',embed=halp) | |
else: | |
if len(cog) > 1: | |
halp = discord.Embed(title='Error!',description='That is way too many cogs!',color=discord.Color.red()) | |
await ctx.message.author.send('',embed=halp) | |
else: | |
found = False | |
for x in self.bot.cogs: | |
for y in cog: | |
if x == y: | |
halp=discord.Embed(title=cog[0]+' Command Listing',description=self.bot.cogs[cog[0]].__doc__) | |
for c in self.bot.get_cog(y).get_commands(): | |
if not c.hidden: | |
halp.add_field(name=c.name,value=c.help,inline=False) | |
found = True | |
if not found: | |
halp = discord.Embed(title='Error!',description='How do you even use "'+cog[0]+'"?',color=discord.Color.red()) | |
else: | |
await ctx.message.add_reaction(emoji='✉') | |
await ctx.message.author.send('',embed=halp) | |
except: | |
pass |
I got this error:
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.Help' has no 'setup' function.
Any help please?
I got this error:
discord.ext.commands.errors.NoEntryPointError: Extension 'cogs.Help' has no 'setup' function.
Any help please?
put this at the end of your help cog
def setup(yourbotname):
yourbotname.add_cog(yourclassname(yourbotname))
and change "yourbotname" to your bot name , "yourclassname" to your class name
I had figured that out, but thanks anyway!
Okay i keep getting 'help' command is not found in my terminal while running it. Other than that no issues though. please help
@bsod2528 you need to add :
def setup(bot):
bot.add_cog(Help(bot))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!