1
Fork 0
mirror of https://github.com/RGBCube/VReplBot synced 2025-07-30 18:07:46 +00:00
This commit is contained in:
RGBCube 2023-02-03 22:48:05 +03:00
parent ede57775f4
commit 710a20c328
2 changed files with 142 additions and 78 deletions

View file

@ -23,6 +23,10 @@ if TYPE_CHECKING:
from .. import ReplBot
class StopCommandExecution(Exception):
pass
class ErrorHandler(Cog):
def __init__(self, bot: ReplBot) -> None:
self.bot = bot
@ -36,7 +40,7 @@ class ErrorHandler(Cog):
if cog._get_overridden_method(cog.cog_command_error) is not None:
return
ignored = (CommandNotFound,)
ignored = (CommandNotFound, StopCommandExecution)
error = getattr(error, "original", error)
if isinstance(error, ignored):