fix(touch): 修复头像缓存问题

- 下载 QQ头像后立即删除,防止缓存
- 优化了触碰功能中的头像处理流程
This commit is contained in:
SlyAimer 2025-03-14 13:41:46 +08:00
parent ce18d17f4b
commit 942b7f257c

View file

@ -24,8 +24,10 @@ async def handle_touch(message: MessageEvent):
result = await QrTouch.touch(0) result = await QrTouch.touch(0)
q.reply_touch_content = result.reply_touch_content q.reply_touch_content = result.reply_touch_content
await QrTouchLog.insert_touch_log(q, member_openid) await QrTouchLog.insert_touch_log(q, member_openid)
local_gif = rua(await download_qq_image_by_account(None)).add_gif() qq_head_image = await download_qq_image_by_account(None)
local_gif = rua(qq_head_image).add_gif()
msg = Message([MessageSegment.file_image(Path(local_gif)), msg = Message([MessageSegment.file_image(Path(local_gif)),
MessageSegment.text(result.reply_touch_content),]) MessageSegment.text(result.reply_touch_content),])
await delete_file(qq_head_image)
await delete_file(local_gif) await delete_file(local_gif)
await to.finish(msg) await to.finish(msg)