From 4dc551a25f487f6a5e977a432645dff10393628d Mon Sep 17 00:00:00 2001 From: yzhh <2596322644@qq.com> Date: Sun, 22 May 2022 23:05:06 +0800 Subject: [PATCH] update --- core/exceptions.py | 7 +++++++ core/parser/command.py | 11 +---------- core/parser/message.py | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/exceptions.py b/core/exceptions.py index e8d34ffa..cbfec7d8 100644 --- a/core/exceptions.py +++ b/core/exceptions.py @@ -6,5 +6,12 @@ class ConfigFileNotFound(Exception): pass +class InvalidHelpDocTypeError(Exception): + pass + + +class InvalidCommandFormatError(Exception): + pass + class FinishedException(BaseException): pass diff --git a/core/parser/command.py b/core/parser/command.py index a01fe25b..727a0f39 100644 --- a/core/parser/command.py +++ b/core/parser/command.py @@ -5,20 +5,11 @@ from typing import Union from core.docopt import docopt, DocoptExit from core.elements import Command, Option, Schedule, StartUp, RegexCommand, command_prefix, MessageSession +from core.exceptions import InvalidCommandFormatError, InvalidHelpDocTypeError command_prefix_first = command_prefix[0] -class InvalidHelpDocTypeError(BaseException): - def __init__(self, *args, **kwargs): - pass - - -class InvalidCommandFormatError(BaseException): - def __init__(self, *args, **kwargs): - pass - - class CommandParser: def __init__(self, args: Union[str, list, tuple, Command, Option, Schedule, StartUp, RegexCommand], prefix=None, msg: MessageSession = None): diff --git a/core/parser/message.py b/core/parser/message.py index 10fe6874..c41f8b78 100644 --- a/core/parser/message.py +++ b/core/parser/message.py @@ -4,10 +4,10 @@ from aiocqhttp.exceptions import ActionFailed from datetime import datetime from core.elements import MessageSession, Command, command_prefix, ExecutionLockList, RegexCommand, ErrorMessage -from core.exceptions import AbuseWarning, FinishedException +from core.exceptions import AbuseWarning, FinishedException, InvalidCommandFormatError, InvalidHelpDocTypeError from core.loader import ModulesManager from core.logger import Logger -from core.parser.command import CommandParser, InvalidCommandFormatError, InvalidHelpDocTypeError +from core.parser.command import CommandParser from core.tos import warn_target from core.utils import remove_ineffective_text, RemoveDuplicateSpace from database import BotDBUtil