Correct subcommands retrieving
This commit is contained in:
parent
3edd9b64de
commit
93a245ffa5
|
@ -63,7 +63,7 @@ class Core:
|
|||
example = None
|
||||
result = None
|
||||
# Also get the subcommands for this command, if they exist
|
||||
subcommands = [x for x in utils.get_subcommands(cmd) if x != cmd.qualified_name]
|
||||
subcommands = [x.qualified_name for x in utils.get_all_subcommands(cmd) if x.qualified_name != cmd.qualified_name]
|
||||
|
||||
# The rest is simple, create the embed, set the thumbail to me, add all fields if they exist
|
||||
embed = discord.Embed(title=cmd.qualified_name)
|
||||
|
|
|
@ -23,14 +23,14 @@ def get_all_commands(bot):
|
|||
"""Returns a list of all command names for the bot"""
|
||||
# First lets create a set of all the parent names
|
||||
for cmd in bot.commands:
|
||||
yield from _get_all_subcommands(cmd)
|
||||
yield from get_all_subcommands(cmd)
|
||||
|
||||
|
||||
def _get_all_subcommands(command):
|
||||
def get_all_subcommands(command):
|
||||
yield command
|
||||
if type(command) is discord.ext.commands.core.Group:
|
||||
for subcmd in command.commands:
|
||||
yield from _get_all_subcommands(subcmd)
|
||||
yield from get_all_subcommands(subcmd)
|
||||
|
||||
|
||||
async def channel_is_nsfw(channel):
|
||||
|
|
Loading…
Reference in a new issue