mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
🎨 Add error handling for InvalidDevice
This commit is contained in:
parent
339f386997
commit
d6d2506f25
@ -14,6 +14,7 @@ from simnet.errors import (
|
|||||||
TimedOut as SIMNetTimedOut,
|
TimedOut as SIMNetTimedOut,
|
||||||
SIMNetException,
|
SIMNetException,
|
||||||
NeedChallenge,
|
NeedChallenge,
|
||||||
|
InvalidDevice,
|
||||||
)
|
)
|
||||||
from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton
|
from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton
|
||||||
from telegram.constants import ParseMode
|
from telegram.constants import ParseMode
|
||||||
@ -145,6 +146,8 @@ class ErrorHandler(Plugin):
|
|||||||
else:
|
else:
|
||||||
logger.error("未知Cookie错误", exc_info=exc)
|
logger.error("未知Cookie错误", exc_info=exc)
|
||||||
notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定"
|
notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定"
|
||||||
|
elif isinstance(exc, InvalidDevice):
|
||||||
|
notice = self.ERROR_MSG_PREFIX + "设备信息无效,请尝试重新设备绑定"
|
||||||
elif isinstance(exc, DataNotPublic):
|
elif isinstance(exc, DataNotPublic):
|
||||||
notice = self.ERROR_MSG_PREFIX + "查询的用户数据未公开"
|
notice = self.ERROR_MSG_PREFIX + "查询的用户数据未公开"
|
||||||
elif isinstance(exc, NeedChallenge):
|
elif isinstance(exc, NeedChallenge):
|
||||||
|
Loading…
Reference in New Issue
Block a user