mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 12:02:16 +00:00
🎨 提高代码质量
This commit is contained in:
parent
08bdd8962b
commit
1b5d7fdf9c
@ -47,6 +47,7 @@ class UpdatePlugin(Plugin):
|
||||
logger.info(f"用户 {user.full_name}[{user.id}] update命令请求")
|
||||
if self._lock.locked():
|
||||
await message.reply_text("程序正在更新 请勿重复操作")
|
||||
return
|
||||
async with self._lock:
|
||||
reply_text = await message.reply_text("正在更新")
|
||||
logger.info(f"正在更新代码")
|
||||
|
@ -78,7 +78,7 @@ def error_callable(func: Callable) -> Callable:
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ 资源未找到 ~ ")
|
||||
return ConversationHandler.END
|
||||
except InvalidCookies as exc:
|
||||
if exc.retcode == 10001 or exc.retcode == -100:
|
||||
if exc.retcode in (10001, -100):
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ Cookies无效,请尝试重新绑定账户")
|
||||
elif exc.retcode == 10103:
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ Cookie有效,但没有绑定到游戏帐户,"
|
||||
@ -112,12 +112,12 @@ def error_callable(func: Callable) -> Callable:
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ API请求错误")
|
||||
return ConversationHandler.END
|
||||
except BadRequest as exc:
|
||||
logger.warning("python-telegram-bot 请求错误")
|
||||
logger.error("python-telegram-bot 请求错误")
|
||||
logger.exception(exc)
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ telegram-bot-api请求错误")
|
||||
return ConversationHandler.END
|
||||
except Forbidden as exc:
|
||||
logger.warning("python-telegram-bot返回 Forbidden")
|
||||
logger.error("python-telegram-bot返回 Forbidden")
|
||||
logger.exception(exc)
|
||||
await send_user_notification(update, context, "出错了呜呜呜 ~ telegram-bot-api请求错误")
|
||||
return ConversationHandler.END
|
||||
|
Loading…
Reference in New Issue
Block a user