[commands] Unwrap CommandInvokeError if the cause is CommandError

This commit is contained in:
Rapptz 2022-04-12 00:55:38 -04:00
parent 3bb4d3bd6d
commit 70d2522e7e

View File

@ -294,7 +294,7 @@ class HybridAppCommand(discord.app_commands.Command[CogT, P, T]):
return await self._do_call(ctx, ctx.kwargs) # type: ignore
except app_commands.CommandSignatureMismatch:
raise
except app_commands.TransformerError as e:
except (app_commands.TransformerError, app_commands.CommandInvokeError) as e:
if isinstance(e.__cause__, CommandError):
exc = e.__cause__
else: