Add detailed help for commands
This commit is contained in:
parent
b5c0e002ab
commit
97d7dc7e25
@ -701,17 +701,17 @@ class Utils:
|
|||||||
# TODO Create Help command
|
# TODO Create Help command
|
||||||
@commands.command(name='help', aliases=['h'])
|
@commands.command(name='help', aliases=['h'])
|
||||||
@commands.cooldown(1, 5, commands.BucketType.user)
|
@commands.cooldown(1, 5, commands.BucketType.user)
|
||||||
async def custom_help(self, ctx, command: str=None):
|
async def custom_help(self, ctx, *, command: str=None):
|
||||||
pag = utils.Paginator(self.bot, embed=True, max_line_length=48)
|
pag = utils.Paginator(self.bot, embed=True, max_line_length=48)
|
||||||
prefixes = await self.bot.get_custom_prefix(self.bot, ctx.message)
|
prefixes = await self.bot.get_custom_prefix(self.bot, ctx.message)
|
||||||
if isinstance(prefixes, list):
|
if isinstance(prefixes, list):
|
||||||
prefixes = ', '.join(prefixes)
|
prefixes = ', '.join(prefixes)
|
||||||
owner = await self.bot.get_user_info(self.bot.owner_id)
|
owner = await self.bot.get_user_info(self.bot.owner_id)
|
||||||
pag.set_embed_meta(title='Geeksbot Help',
|
|
||||||
description=f'For more information about a command please run\n'
|
|
||||||
f'{prefixes.split(",")[0]}help [group] <command>',
|
|
||||||
thumbnail=f'{ctx.guild.me.avatar_url}')
|
|
||||||
if command is None:
|
if command is None:
|
||||||
|
pag.set_embed_meta(title='Geeksbot Help',
|
||||||
|
description=f'For more information about a command please run\n'
|
||||||
|
f'{prefixes.split(",")[0]}help [group] <command>',
|
||||||
|
thumbnail=f'{ctx.guild.me.avatar_url}')
|
||||||
pag.add(f"\uFFF6Welcome to Geeksbot's help command.\n"
|
pag.add(f"\uFFF6Welcome to Geeksbot's help command.\n"
|
||||||
f"< {self.bot.description} >\n\n"
|
f"< {self.bot.description} >\n\n"
|
||||||
f"Below you will find some basic information about me.\n\n"
|
f"Below you will find some basic information about me.\n\n"
|
||||||
@ -735,6 +735,22 @@ class Utils:
|
|||||||
pass
|
pass
|
||||||
pag.add('\uFFF7')
|
pag.add('\uFFF7')
|
||||||
pag.add('\uFFF8')
|
pag.add('\uFFF8')
|
||||||
|
else:
|
||||||
|
pag.set_embed_meta(title='Geeksbot Help',
|
||||||
|
thumbnail=f'{ctx.guild.me.avatar_url}')
|
||||||
|
command = command.split(maxsplit=1)
|
||||||
|
if command[0] in self.bot.all_commands:
|
||||||
|
if len(command) > 1 and self.bot.all_commands[command[0]].group:
|
||||||
|
command = self.bot.all_commands[command[0]].all_commands.get(command[1], None)
|
||||||
|
else:
|
||||||
|
command = self.bot.all_commands[command[0]]
|
||||||
|
else:
|
||||||
|
command = None
|
||||||
|
|
||||||
|
if command and not command.hidden:
|
||||||
|
pag.add(f'\uFFF6{command.name}')
|
||||||
|
pag.add(f'{command.help}')
|
||||||
|
|
||||||
book = utils.Book(pag, (None, ctx.channel, self.bot, ctx.message))
|
book = utils.Book(pag, (None, ctx.channel, self.bot, ctx.message))
|
||||||
await book.create_book()
|
await book.create_book()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user