mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🎨 Fix Some Issues Identified
🎨 Improve f-string used without any expression 🎨 Remove unnecessary else / elif used after return
This commit is contained in:
parent
656b1e8404
commit
f1de1c987d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user