更新 conversation_error_handler 对异常的处理

This commit is contained in:
洛水居室 2022-07-04 15:46:25 +08:00
parent 6ed9a15914
commit f21ebc51a1
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -80,14 +80,16 @@ def conversation_error_handler(func: Callable) -> Callable:
await send_user_notification(update, context, "出错了呜呜呜 ~ 服务器连接超时 服务器熟啦 ~ ")
return ConversationHandler.END
except TimedOut:
Log.error("python-telegram-TimedOut模块连接服务器TimedOut")
Log.error("python-telegram-bot 模块连接服务器 TimedOut")
await send_user_notification(update, context, "出错了呜呜呜 ~ 服务器连接超时 服务器熟啦 ~ ")
return ConversationHandler.END
except InvalidCookies as exc:
Log.warning("Cookie错误", exc)
if "10001" in str(exc):
if "[10001]" in str(exc):
await send_user_notification(update, context, "Cookies无效请尝试重新绑定账户")
elif "10103" in str(exc):
elif "[-100]" in str(exc):
await send_user_notification(update, context, "Cookies无效请尝试重新绑定账户")
elif "[10103]" in str(exc):
await send_user_notification(update, context, "Cookie有效但没有绑定到游戏帐户请尝试重新绑定邮游戏账户")
else:
await send_user_notification(update, context, "Cookies无效具体原因未知")