mirror of
https://github.com/RGBCube/VReplBot
synced 2025-07-30 18:07:46 +00:00
Refactor
This commit is contained in:
parent
ede57775f4
commit
710a20c328
2 changed files with 142 additions and 78 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue