diff --git a/core/config.py b/core/config.py index d0f01f93..c97e6d24 100644 --- a/core/config.py +++ b/core/config.py @@ -37,7 +37,8 @@ class BotConfig(BaseSettings): redis_db: int = 0 bot_token: str = "" - error_notification_chat_id: str = "" + + error_notification_chat_id: Optional[str] = None api_id: Optional[int] = None api_hash: Optional[str] = None diff --git a/plugins/system/errorhandler.py b/plugins/system/errorhandler.py index 3458db61..998fa187 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -35,7 +35,7 @@ class ErrorHandler(Plugin): logger.error("处理函数时发生异常") logger.exception(context.error, exc_info=(type(context.error), context.error, context.error.__traceback__)) - if notice_chat_id is None: + if notice_chat_id: return tb_list = traceback.format_exception(None, context.error, context.error.__traceback__)