🐛 Fix handle NeedChallenge

This commit is contained in:
xtaodada 2023-11-16 13:19:02 +08:00
parent a39ad6a249
commit 43b5ce34d2
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -12,6 +12,7 @@ from simnet.errors import (
TooManyRequests, TooManyRequests,
CookieException, CookieException,
TimedOut as SIMNetTimedOut, TimedOut as SIMNetTimedOut,
NeedChallenge,
) )
from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton from telegram import ReplyKeyboardRemove, Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.constants import ParseMode from telegram.constants import ParseMode
@ -143,11 +144,11 @@ class ErrorHandler(Plugin):
notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定" notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定"
elif isinstance(exc, DataNotPublic): elif isinstance(exc, DataNotPublic):
notice = self.ERROR_MSG_PREFIX + "查询的用户数据未公开" notice = self.ERROR_MSG_PREFIX + "查询的用户数据未公开"
elif isinstance(exc, NeedChallenge):
notice = self.ERROR_MSG_PREFIX + "服务器检测到该账号可能存在异常,请求被拒绝,请尝试通过验证"
else: else:
if exc.retcode == -130: if exc.retcode == -130:
notice = self.ERROR_MSG_PREFIX + "未设置默认角色,请尝试重新绑定" notice = self.ERROR_MSG_PREFIX + "未设置默认角色,请尝试重新绑定"
elif exc.retcode == 1034:
notice = self.ERROR_MSG_PREFIX + "服务器检测到该账号可能存在异常,请求被拒绝,请尝试通过验证"
elif exc.retcode == -500001: elif exc.retcode == -500001:
notice = self.ERROR_MSG_PREFIX + "网络出小差了,请稍后重试~" notice = self.ERROR_MSG_PREFIX + "网络出小差了,请稍后重试~"
elif exc.retcode == -1: elif exc.retcode == -1: