mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 修复未配置错误通知时依然发送日记导致的异常
This commit is contained in:
parent
333994281e
commit
24c63002cd
@ -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
|
||||
|
@ -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__)
|
||||
|
Loading…
Reference in New Issue
Block a user