fix(jm_download): 添加下载提示和空输入校验

在下载前发送等待提示,并检查输入是否为空
This commit is contained in:
SlyAimer 2025-03-31 18:08:57 +08:00
parent 7a58497e5f
commit c7695b7459

View file

@ -8,8 +8,12 @@ from src.clover_image.delete_file import delete_file
jm = on_command("jm", rule=to_me(), priority=10,block=False)
@jm.handle()
async def handle_function(message: MessageEvent):
await jm.send("正在下载中,请稍等")
key = message.get_plaintext().replace("/jm", "").strip(" ")
if key == "":
await jm.finish("请输入jm的id")
output_file = await download_jm(key)
await jm.send(MessageSegment.file_image(Path(output_file)))
await delete_file(output_file)