From f1de1c987dae1b451042f60588e05f4b89302a96 Mon Sep 17 00:00:00 2001 From: luoshuijs Date: Wed, 6 Sep 2023 15:27:03 +0800 Subject: [PATCH] :art: Fix Some Issues Identified :art: Improve f-string used without any expression :art: Remove unnecessary else / elif used after return --- core/dependence/assets.py | 2 +- plugins/system/errorhandler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dependence/assets.py b/core/dependence/assets.py index 4e721675..f02676df 100644 --- a/core/dependence/assets.py +++ b/core/dependence/assets.py @@ -473,7 +473,7 @@ class _NamecardAssets(_AssetsService): for namecard_id, namecard_data in NAMECARD_DATA.items(): if namecard_data["icon"].split("_")[-1] == avatar_icon_name: return int(namecard_id) - elif avatar_icon_name in namecard_data["icon"].split("_")[-1]: + if avatar_icon_name in namecard_data["icon"].split("_")[-1]: fallback = int(namecard_id) if fallback: return fallback diff --git a/plugins/system/errorhandler.py b/plugins/system/errorhandler.py index f709d136..d418d682 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -140,7 +140,7 @@ class ErrorHandler(Plugin): notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定" elif isinstance(exc, CookieException): if exc.retcode == 0: - notice = self.ERROR_MSG_PREFIX + "Cookie 已经被刷新,请尝试重试操作~" + notice = self.ERROR_MSG_PREFIX + "Cookie 已经被刷新,请尝试重试发送命令~" else: logger.error("未知Cookie错误", exc_info=exc) notice = self.ERROR_MSG_PREFIX + f"Cookie 无效 错误信息为 {exc.original} 请尝试重新绑定" @@ -164,7 +164,7 @@ class ErrorHandler(Plugin): if message: notice = self.ERROR_MSG_PREFIX + f"获取信息发生错误 错误信息为 {message} ~ 请稍后再试" else: - notice = self.ERROR_MSG_PREFIX + f"获取信息发生错误 请稍后再试" + notice = self.ERROR_MSG_PREFIX + "获取信息发生错误 请稍后再试" if notice: self.create_notice_task(update, context, notice) raise ApplicationHandlerStop