From 9d8be27e351d021e87aad04fe22cad451c6f06cb Mon Sep 17 00:00:00 2001 From: lena <77104725+elenakrittik@users.noreply.github.com> Date: Sat, 4 Nov 2023 16:38:52 +0300 Subject: [PATCH] fix: Properly replace exception Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com> Signed-off-by: lena <77104725+elenakrittik@users.noreply.github.com> --- disnake/ext/commands/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disnake/ext/commands/core.py b/disnake/ext/commands/core.py index 5115cb96cb..2bb108e966 100644 --- a/disnake/ext/commands/core.py +++ b/disnake/ext/commands/core.py @@ -1867,7 +1867,8 @@ def app_check_any(*checks: AppCheck) -> Callable[[T], T]: try: return check_any(*checks) # type: ignore # impl is the same, typings are different except TypeError as e: - raise TypeError(str(e).replace("commands.check", "commands.app_check")) # fix err message + msg = str(e).replace("commands.check", "commands.app_check") # fix err message + raise TypeError(msg) from None def has_role(item: Union[int, str]) -> Callable[[T], T]: