mirror of
https://github.com/miaowware/qrm2.git
synced 2024-11-26 17:58:40 -05:00
WIP: help command checks
This commit is contained in:
parent
4e73fa3734
commit
61f0c9423e
@ -61,6 +61,7 @@ class QrmHelpCommand(commands.HelpCommand):
|
||||
'. Many commands have shorter aliases.')
|
||||
|
||||
for cat, cmds in mapping.items():
|
||||
if self.context.author.id not in opt.owners_uids:
|
||||
cmds = list(filter(lambda x: not x.hidden, cmds))
|
||||
if cmds == []:
|
||||
continue
|
||||
@ -72,16 +73,21 @@ class QrmHelpCommand(commands.HelpCommand):
|
||||
await self.context.send(embed=embed)
|
||||
|
||||
async def send_command_help(self, command):
|
||||
if not command.hidden or self.context.author.id in opt.owners_uids:
|
||||
embed = cmn.embed_factory(self.context)
|
||||
embed.title = self.get_command_signature(command)
|
||||
embed.description = command.help
|
||||
await self.context.send(embed=embed)
|
||||
else:
|
||||
await cmn.add_react(self.context, cmn.no_entry)
|
||||
|
||||
async def send_group_help(self, group):
|
||||
if not group.hidden or self.context.author.id in opt.owners_uids:
|
||||
embed = cmn.embed_factory(self.context)
|
||||
embed.title = self.get_command_signature(group)
|
||||
embed.description = group.help
|
||||
for cmd in group.commands:
|
||||
if not cmd.hidden or self.context.author.id in opt.owners_uids:
|
||||
embed.add_field(name=self.get_command_signature(cmd), value=cmd.help, inline=False)
|
||||
await self.context.send(embed=embed)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user