mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +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,
|
||||
uid: str,
|
||||
bak: bool = False,
|
||||
):
|
||||
) -> Path:
|
||||
"""获取文件路径
|
||||
:param user_id: 用户 ID
|
||||
:param uid: UID
|
||||
|
@ -218,6 +218,8 @@ class PayLogPlugin(Plugin.Conversation, BasePlugin.Conversation):
|
||||
client = await get_genshin_client(user.id, need_cookie=False)
|
||||
await message.reply_chat_action(ChatAction.TYPING)
|
||||
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_document(document=open(path, "rb+"), caption="充值记录导出文件")
|
||||
except PayLogNotFound:
|
||||
|
Loading…
Reference in New Issue
Block a user