mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-22 06:17:54 +00:00
🐛 Fix FileNotFoundError in pay_log plugin
This commit is contained in:
parent
fc4be627b4
commit
34bdd0ef53
@ -39,7 +39,7 @@ class PayLog:
|
|||||||
user_id: str,
|
user_id: str,
|
||||||
uid: str,
|
uid: str,
|
||||||
bak: bool = False,
|
bak: bool = False,
|
||||||
):
|
) -> Path:
|
||||||
"""获取文件路径
|
"""获取文件路径
|
||||||
:param user_id: 用户 ID
|
:param user_id: 用户 ID
|
||||||
:param uid: UID
|
:param uid: UID
|
||||||
|
@ -218,6 +218,8 @@ class PayLogPlugin(Plugin.Conversation, BasePlugin.Conversation):
|
|||||||
client = await get_genshin_client(user.id, need_cookie=False)
|
client = await get_genshin_client(user.id, need_cookie=False)
|
||||||
await message.reply_chat_action(ChatAction.TYPING)
|
await message.reply_chat_action(ChatAction.TYPING)
|
||||||
path = self.pay_log.get_file_path(str(user.id), str(client.uid))
|
path = self.pay_log.get_file_path(str(user.id), str(client.uid))
|
||||||
|
if not path.exists():
|
||||||
|
raise PayLogNotFound
|
||||||
await message.reply_chat_action(ChatAction.UPLOAD_DOCUMENT)
|
await message.reply_chat_action(ChatAction.UPLOAD_DOCUMENT)
|
||||||
await message.reply_document(document=open(path, "rb+"), caption="充值记录导出文件")
|
await message.reply_document(document=open(path, "rb+"), caption="充值记录导出文件")
|
||||||
except PayLogNotFound:
|
except PayLogNotFound:
|
||||||
|
Loading…
Reference in New Issue
Block a user