diff --git a/extensions/extension.py b/extensions/extension.py index be97d44..cad55bb 100644 --- a/extensions/extension.py +++ b/extensions/extension.py @@ -55,7 +55,8 @@ class Extension(commands.Cog): @commands.Cog.listener() async def on_command_error(self, ctx: commands.Context, error): - if ctx.invoked_with == extension_name: + if ctx.invoked_with == extension_name or \ + (ctx.command.root_parent is not None and ctx.command.root_parent.name == extension_name): if isinstance(error, NotOwner): await ctx.message.add_reaction("\u274C") elif isinstance(error, CommandNotFound): diff --git a/extensions/purge.py b/extensions/purge.py index aa43ab9..0b64a35 100644 --- a/extensions/purge.py +++ b/extensions/purge.py @@ -58,7 +58,8 @@ class Purge(commands.Cog): @commands.Cog.listener() async def on_command_error(self, ctx: commands.Context, error): - if ctx.invoked_with == extension_name: + if ctx.invoked_with == extension_name or \ + (ctx.command.root_parent is not None and ctx.command.root_parent.name == extension_name): if isinstance(error, CommandNotFound): await ctx.message.add_reaction("\u2753") else: