From 8b17c74d9e46faedd9726e51535b2a0a7fa5cf02 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 9 Jun 2024 21:30:44 +0800 Subject: [PATCH] :bug: Add TooManyRequestPublicCookies to error handler --- plugins/system/errorhandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/system/errorhandler.py b/plugins/system/errorhandler.py index 746295a..c42b498 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -25,7 +25,7 @@ from telegram.helpers import create_deep_linked_url from core.config import config from core.plugin import Plugin, error_handler -from gram_core.services.cookies.error import CookieServiceError as PublicCookieServiceError +from gram_core.services.cookies.error import TooManyRequestPublicCookies from gram_core.services.players.error import PlayerNotFoundError from modules.apihelper.error import APIHelperException, APIHelperTimedOut, ResponseException, ReturnCodeError from modules.errorpush import ( @@ -274,9 +274,9 @@ class ErrorHandler(Plugin): @error_handler() async def process_public_cookies(self, update: object, context: CallbackContext): - if not isinstance(context.error, PublicCookieServiceError) or not isinstance(update, Update): + if not isinstance(context.error, TooManyRequestPublicCookies) or not isinstance(update, Update): return - self.create_notice_task(update, context, "公共Cookies池已经耗尽,请稍后重试或者绑定账号") + self.create_notice_task(update, context, config.notice.user_not_found) raise ApplicationHandlerStop @error_handler(block=False)