Skip to content

Commit

Permalink
#864: Fix parsing in command_cog (#865)
Browse files Browse the repository at this point in the history
* #864: Fix parsing in command_cog

* #864: Use qualified name in !command

---------

Co-authored-by: Jay Madden <jaymaddencox@gmail.com>
Co-authored-by: Justin Kristensen <jlkris007@gmail.com>
  • Loading branch information
3 people authored Nov 22, 2023
1 parent 92a31e4 commit e312f27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion ClemBot.Bot/bot/cogs/command_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def command(
opp_mode = "enable" if model.guild_disabled else "disable"
embed.set_footer(
text=f"You can {opp_mode} this command globally by typing "
f'"{await self.bot.current_prefix(ctx)}cmd {opp_mode} {cmd.name}"'
f'"{await self.bot.current_prefix(ctx)}cmd {opp_mode} {cmd.qualified_name}"'
)
await ctx.send(embed=embed)

Expand Down
12 changes: 0 additions & 12 deletions ClemBot.Bot/bot/utils/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ async def convert(self, ctx: Context[BotT], argument: str) -> ext.ClemBotCommand
except (AttributeError, KeyError):
raise ConversionError()

for i, name in enumerate(self.accu[1:]):
# Check if the newly parsed command is a group which means we need to check the next
# value to see if it's a valid sub-command

if not isinstance(command, ext.ClemBotGroup):
raise ConversionError()

try:
command = command.all_commands[name]
except (AttributeError, KeyError):
raise ConversionError()

# All Clembot commands should be ClemBotCommands by default so this should never fail
return t.cast(ext.ClemBotCommand, command)

Expand Down

0 comments on commit e312f27

Please sign in to comment.