mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🐛 Add TooManyRequestPublicCookies to error handler
This commit is contained in:
parent
749827ea72
commit
51e7b5cdbe
@ -25,6 +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 TooManyRequestPublicCookies
|
||||
from gram_core.services.players.error import PlayerNotFoundError
|
||||
from modules.apihelper.error import APIHelperException, APIHelperTimedOut, ResponseException, ReturnCodeError
|
||||
from modules.errorpush import (
|
||||
@ -271,6 +272,13 @@ class ErrorHandler(Plugin):
|
||||
self.create_notice_task(update, context, config.notice.user_not_found)
|
||||
raise ApplicationHandlerStop
|
||||
|
||||
@error_handler()
|
||||
async def process_public_cookies(self, update: object, context: CallbackContext):
|
||||
if not isinstance(context.error, TooManyRequestPublicCookies) or not isinstance(update, Update):
|
||||
return
|
||||
self.create_notice_task(update, context, config.notice.user_not_found)
|
||||
raise ApplicationHandlerStop
|
||||
|
||||
@error_handler(block=False)
|
||||
async def process_z_error(self, update: object, context: CallbackContext) -> None:
|
||||
# 必须 `process_` 加上 `z` 保证该函数最后一个注册
|
||||
|
Loading…
Reference in New Issue
Block a user