AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

Improve: 优化 QQ 下自动下载文件的问题

Open Soulter opened this issue 7 months ago • 4 comments

Motivation

现在 AstrBot 会下载每一个 QQ 协议端下发的文件并且没有定期消费机制,长期堆积可能导致用户磁盘被占满。

Modifications

‼️ BREAKING CHANGE: File 消息段的 file 字段将可能将下发 https 协议的链接。

Check

  • [x] 😊 我的 Commit Message 符合良好的规范
  • [ ] 👀 我的更改经过良好的测试
  • [x] 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。
  • [x] 😮 我的更改没有引入恶意代码

好的,这是将拉取请求摘要翻译成中文的结果:

Sourcery 总结

优化 QQ 协议适配器的文件处理方式,更改文件处理和检索方式

新特性:

  • 支持直接从 QQ 协议适配器检索文件 URL

Bug 修复:

  • 避免不必要的本地文件下载
  • 移除潜在的磁盘空间累积问题

增强功能:

  • 修改 File 消息组件以支持基于 URL 的文件处理
  • 改进不同消息类型(群消息和好友消息)的文件检索

日常维护:

  • 更新文件处理逻辑,使其对不同的 QQ 协议客户端更具灵活性
Original summary in English

Summary by Sourcery

Optimize file handling for QQ protocol adapters by changing how files are processed and retrieved

New Features:

  • Support for retrieving file URLs directly from QQ protocol adapters

Bug Fixes:

  • Prevent unnecessary local file downloads
  • Remove potential disk space accumulation issues

Enhancements:

  • Modify File message component to support URL-based file handling
  • Improve file retrieval for different message types (group and friend messages)

Chores:

  • Update file handling logic to be more flexible with different QQ protocol clients

Soulter avatar Apr 30 '25 13:04 Soulter