修复图库内图片无法被连续删除的问题

This commit is contained in:
VirtualTowel 2022-07-01 20:12:39 +08:00
parent 27b89b333a
commit 57a7903c63

View File

@ -65,8 +65,8 @@ async def arg_handle(
if int(img_id) > max_id or int(img_id) < 0:
await delete_img.finish(f"Id超过上下限上限{max_id}", at_sender=True)
try:
if (TEMP_PATH / "delete.jpg").exists():
(TEMP_PATH / "delete.jpg").unlink()
if (TEMP_PATH / f"{event.user_id}_delete.jpg").exists():
(TEMP_PATH / f"{event.user_id}_delete.jpg").unlink()
logger.info(f"删除{cn2py(state['path'])}图片 {img_id}.jpg 成功")
except Exception as e:
logger.warning(f"删除图片 delete.jpg 失败 e{e}")