Commit Graph
644 Commits
Author SHA1 Message Date
nezumi 9356ae6d8b docs: translate value object documentation to Vietnamese
Translate platform capability and unified group value-object documentation into Vietnamese.
2026-07-23 17:12:59 +07:00
nezumi 33dd6f9119 Merge pull request #5 from Nezumi-2711/docs/vietnamese-data-models
docs: localize data models to Vietnamese
2026-07-23 00:05:20 +07:00
nezumi 7b71f89ae2 docs: localize data models to Vietnamese
Việt hóa docstring và chú thích trong data models, giữ nguyên logic và cấu trúc dữ liệu.
2026-07-23 00:01:15 +07:00
nezumi fdefb8a073 Merge pull request #4 from Nezumi-2711/docs/vietnamese-shared-module
docs: Việt hóa tài liệu module shared
2026-07-22 22:59:04 +07:00
nezumi a89b92c8f9 docs: localize shared module documentation to Vietnamese
Translate Chinese docstrings and comments in the shared module to Vietnamese without changing runtime logic or public API values.
2026-07-22 22:57:12 +07:00
nezumi 7e1d7cb50c feat: add copilot instruction file 2026-07-22 18:06:06 +07:00
nezumi 0e6f15369d Merge pull request #3 from Nezumi-2711/feat/vietnamese-localization
feat(i18n): add Vietnamese localization
2026-07-22 18:05:20 +07:00
nezumi 5aefec8dcf feat(i18n): add Vietnamese localization 2026-07-22 18:02:17 +07:00
nezumi e066b9c131 Merge pull request #2 from Nezumi-2711/i18n/vietnamese-domain-exceptions
feat(i18n): localize domain exceptions to Vietnamese
2026-07-22 16:14:11 +07:00
nezumi 6c0b347cd1 feat(i18n): localize domain exceptions to Vietnamese 2026-07-22 16:11:19 +07:00
nezumi d5680dc0d3 Merge pull request #1 from Nezumi-2711/i18n/vietnamese-qq-official-markdown
feat(i18n): Việt hoá báo cáo QQ Official Markdown
2026-07-22 15:36:12 +07:00
nezumi 7f88528b3a fix(i18n): clarify highlighted quote heading
Use a clearer, more natural Vietnamese heading for highlighted quotes in QQ Official Markdown reports. The unrelated working-tree change in .github/copilot-instructions.md is intentionally excluded.
2026-07-22 15:35:15 +07:00
nezumi 2218e3310e feat(i18n): localize QQ markdown reports to Vietnamese
Translate QQ Official Markdown report labels, headings, dashboard text, date display, and logs to Vietnamese. Update localization assertions while preserving report logic.
2026-07-22 15:20:26 +07:00
SXP-Simon 04fa154a28 [v4.11.2] - 🛠️ 定时报告可同时发送多种格式,可关闭报告发送时的 “📊 每日群聊分析报告已生成” 文字前缀 2026-07-21 16:33:00 +08:00
SXP-Simon 938ae5ddaf feat: 新增 show_report_caption 选项,可关闭报告发送时的文字前缀 2026-07-21 16:22:20 +08:00
SXP-Simon eb8da860d5 fix(conf): output_format 改为 list 类型支持多选 2026-07-21 15:54:24 +08:00
SXP-Simon c19332a887 feat: output_format 支持多选,报告可同时发送多种格式
- ConfigManager: get_output_format 改为返回 list,向后兼容旧 string 值
- set_output_format 接受逗号分隔的格式列表
- Dispatcher: dispatch() 循环所有选中格式逐一分发
- manual (/群分析): 使用列表中的第一种格式
- 命令 /设置格式: 支持 image,html 等逗号分隔多选
- 配置面板 output_format 改为 list 类型 (可多选)
2026-07-21 15:50:31 +08:00
SXP-Simon 3a03c1f272 feat(filter_bot_messages): 新增 filter_bot 开关,控制 bot 消息是否纳入分析
Fixes #205

默认排除 bot 自身发言(filter_bot_messages=True),可通过 /分析设置 filter_bot 切换。
修改涉及三层:
1. 配置层:ConfigManager getter/setter + _conf_schema.json 面板选项
2. 适配器层:BotManager 传入配置,OneBotAdapter.fetch_messages 认 switch
3. 分析层:clean_messages 和 analyze_user_activity 的 bot_self_ids 受 switch 控制
2026-07-21 15:42:47 +08:00
SXP-Simon b88082f662 fix(README): BA 模板展示图 2026-07-21 14:56:57 +08:00
clown145andSXP-Simon f2bcd6801e [v4.11.1] - 🛠️ 修复 QQ 官方机器人昵称与提及清洗 (#207)
Fix QQ official nickname and mention handling 

* fix: restore QQ official nicknames and sanitize mentions

* fix: protect QQ official identities and whitespace

* docs: update QQ official nickname guidance

* chore: bump version to v4.11.1

* docs: remove obsolete PDF guidance

* chore: finalize v4.11.1 release prep

* fix(qqofficial): 修复 _sanitize_qq_official_mentions .strip() 吞换行,补充 allow_alphanumeric_user_ids 注释

- .strip() → .strip(' \t'):仅清除首尾空白/制表符,保留用户创作的 \n 换行
- allow_alphanumeric_user_ids:在参数定义处补充注释,说明该标记还控制 ID 正则化和回退显示名
- 响应 Sourcery 代码审查 #207 指出的问题

* chore:  删除不必要的描述

---------

Co-authored-by: SXP-Simon <sxp20061207@163.com>
2026-07-21 14:53:31 +08:00
SXP-Simon 20019baa2c fix(README): 删除过期的描述,调整 BA 模板展示图 2026-07-20 14:57:01 +08:00
clown145andSXP-Simon c18224cb82 [v4.11.0] - 新增 QQ 官方机器人群聊分析与专用 Markdown 报告 (@clown145 #206)
* feat: add QQ official bot group analysis support

* fix: use text progress replies for QQ official bot

* fix: harden QQ official proactive reporting

* feat: enhance QQ official markdown reports

* refactor: isolate QQ official markdown reporting

* fix: restore platform adapter exports

* style: format QQ official changes

* fix(main): 添加 html_render 类型声明和 Callable 导入

为 self.html_render 属性添加显式类型声明,解决定时任务中可能因缺少类型注解导致的隐式错误。

* fix(analysis): 消除 execute_daily_analysis 中重复的 bot_self_ids 赋值

去除第二次冗余的 config_manager.get_bot_self_ids() 调用,直接复用已获取的变量。

* cleanup(domain): 移除未使用的分析器适配器和死代码服务文件

删除 golden_quote_analyzer.py、topic_analyzer.py、user_title_analyzer.py(均为未被引用的接口+适配器包装)report_generator.py(旧的文本报告生成器)statistics_calculator.py(与 StatisticsService 功能重复)更新 domain/services/__init__.py 移除对上述文件的引用。

* cleanup(domain): 移除冗余的实体和值对象文件,收敛数据模型至 domain/models/data_models.py

删除 analysis_result.py(与 data_models.py 重复的 SummaryTopic/UserTitle/GoldenQuote 等类定义)value_objects/golden_quote.py、statistics.py、topic.py、user_title.py(均为未被引用的 frozen dataclass 迁移残留)。所有活跃代码已统一导入 domain/models/data_models.py。

* refactor(llm): 抽取 _make_session_id 辅助方法消除重复代码

在 5 个方法(analyze_topics、analyze_user_titles、analyze_golden_quotes、analyze_all_concurrent、analyze_incremental_concurrent)中出现完全相同的 datetime.now().strftime(...) + umo 拼接逻辑,已提取为 _make_session_id 静态方法。

* refactor(message): 正则表达式提升为模块级常量避免重复编译

DISCORD_CUSTOM_EMOJI_PATTERN 和 COMMAND_PATTERN 从类属性移至模块级常量,避免每次实例化 MessageCleanerService 时重新编译正则。

* arch(domain): 定义 IActivityVisualizer 接口并通过依赖注入消除领域层反向依赖

创建 IActivityVisualizer 接口于 domain/repositories/visualization_repository.py,StatisticsService 改由依赖注入接收该接口;ActivityVisualizer 继承接口。消除原 StatisticsService 直接 import infrastructure.visualization 的 DDD 违规。

* fix(main): 补全 Callable 导入和 html_render 类型声明

初次提交(877adb6)因 git add -p 交互式分块时 BOM 导致错误的 hunk 被暂存,Callable 导入和 html_render 类型声明丢失。本次补全这两项修改。

* fix(platform): 补充 QQOfficialAdapter、TelegramAdapter、DiscordAdapter 导出

* refactor(main): 提取内嵌的文本报告生成/发送函数为独立类方法

将 _send_analysis_report 方法中的 generate_text_reports() 和 send_text_reports() 内嵌异步函数提取为 _generate_text_reports 和 _send_text_reports 私有方法。减少闭包复杂度,提升可维护性。

* cleanup(config): 移除废弃的 get_qq_official_t2i_activity_histogram_enabled 向后兼容方法

删除 config_manager.py 中的旧名别名方法,简化 qq_official_markdown.py 中对应的 getattr 回退逻辑为直接方法调用,移除测试中专门验证旧名兼容性的 LegacyDisabledConfig 测试用例。该兼容层仅在迁移期间临时存在,现已完成过渡。

* fix(types): 修复 Pylance 类型告警 — platform_key 未绑定、int(object) 和 template.filename 可能为 None

platform_group_registry.py: 将 platform_key 定义提前,消除 Pylance reportPossiblyUnboundVariable 告警。
qq_official_markdown.py: 将 int(value or 0) 改为 int(value) if value is not None else 0,消除 reportArgumentType 告警。
templates.py: 在使用 template.filename 前增加 None 检查,消除 str|None 不可分配给 str 的告警。
qq_official_adapter.py: 为 post_group_message 添加类型忽略注解,消除 await 不可等待对象的告警。

* fix(types): 修复残留的 Pylance 类型告警

platform_group_registry.py: 将 (platform_key, group_id) 改为 (str(platform_key), group_id),消除 str|None 不可分配给 str 的 reportArgumentType
qq_official_markdown.py: int(value) 添加 # type: ignore[arg-type],消除 object 不可分配给 ConvertibleToInt
qq_official_adapter.py: 移除无意义的中间变量,await 行直接添加 # type: ignore[arg-type]

* docs(message): 更新 MessageProcessingService 的文档和注释,消除 Telegram 特殊性表述

类 docstring:移除 '维护 Telegram 群组注册表' 等过时描述,补充 QQ 官方去重职责。
group_registry.upsert 注释:改为泛化的跨平台描述,不再限定 Telegram。
_extract_event_timestamp / _reserve_event_id / _commit_event_id / _release_event_id:英文 docstring 统一为中文。

* docs(message): 修正类注释中只提 QQ 官方的问题,明示 Telegram 也由本服务处理

Telegram 和 QQ 官方消息都经过 MessageProcessingService.process_message()。修正前类 docstring 只提了 QQ 官方的事件去重,缺少 Telegram 作为主要调用者的说明。

* fix(types): 修正 _sanitize_analysis_result_for_export 返回类型注解

函数声明 -> dict 但 _sanitize_export_identity_text 可返回 str|dict|list,Pylance 报 reportReturnType。
改为 -> dict[str, Any] 准确表达实际返回类型,补充缺失的 from typing import Any。

* fix(types): 抑制 Pylance reportReturnType 误报

_sanitize_analysis_result_for_export 的 analysis_result 参数运行时始终为 dict,但 _to_plain_export_data 递归返回 Any 导致 Pylance 推导出 str|dict|list 联合类型。
添加 # type: ignore[return-type] 抑制此误报。

* fix(report): 渲染匿名模式下的未知引用 token 不再静默丢弃

当 hide_user_names=True 且 [id] 不在 known_ids 中时,之前返回空 Markup 导致 token 被静默移除,可能扭曲文本语义。改为返回转义后的原始 [id] 字符串,保留文本布局和语义,同时不泄露身份信息。
参考 Sourcery AI code review 建议。

* fix(import): 避免从 astrbot.core 直接导入 File,优先使用公开 API

astrbot.core 是内部模块,不在公开 API 契约中,可能随版本变化。
改为 try 优先导入 astrbot.api.message_components.File(公开 API),
失败时回退到 astrbot.core.message.components.File(向后兼容)。
同时修复 main.py 和 qq_official_adapter.py 两处导入。

* fix(import): 回退 try/except 伪装,改为直接导入 + 风险注释

astrbot.api.message_components 不存在,try/except 永远走 except 分支,是无效代码。
改为直接 from astrbot.core.message.components import File,用注释说明这是内部 API 可能变化。

* fix(ruff): 代码质量

* docs(README): 调整文档说明,删除 lark 相关的描述和功能标识

* docs(desc): 更新 desc

* fix(message): 将 TG 和 QQ 官方消息缓存成功日志降为 debug

* perf(message): 将 _extract_event_timestamp 延迟到 QQ 官方分支内计算

该时间戳仅用于 QQ 官方消息的 history_content 元数据,但对所有平台都执行了深度 getattr 链。
改为只在 QQ 官方分支内延迟计算,消除 Telegram 等平台上每次消息的白算开销。

* chore(CHANGELOG)

---------

Co-authored-by: SXP-Simon <sxp20061207@163.com>
2026-07-20 03:24:50 +08:00
SXP-Simon 6b2d4b1dc3 [v4.10.9] - 新增模板 ”BlueArchive“ 蔚蓝档案 (@VanillaNahida) 2026-07-12 22:20:51 +08:00
香草味的纳西妲喵 a36d339f0f feat: 新增模板 ”BlueArchive“ 蔚蓝档案 (#196)
* feat: 新增渲染模板”BlueArchive“(蔚蓝档案)

* 修复图片无法显示
2026-07-12 12:21:23 +08:00
SXP-Simon 06fb17bdc2 [v4.10.8] - 🛠️ snowluma 被禁言避免触发分析修复 (#191) 2026-07-10 20:32:34 +08:00
SXP-Simon da410b67cd fix(muted): 禁言跳过分析功能兼容 snowluma
由于 SnowLuma 的 get_group_member_info 和 get_group_info 本身没有返回禁言字段,禁言检测的唯一路径就是 set_reaction 失败;依赖 SnowLuma/OIDB 操作被拒时返回特定值判断被禁言实现禁言记录并且跳过不必要的分析
2026-07-10 19:46:44 +08:00
SXP-Simon 3979a30787 [v4.10.7] - 被禁言避免触发分析功能浪费 token,重构并优化模型请求的重试与降级补偿机制 2026-07-10 15:34:13 +08:00
SXP-Simon 24db140382 fix(muted): set_reaction 失败的情况可能是禁言,直接判断为处于禁言状态 2026-07-10 15:14:26 +08:00
SXP-Simon cd21776b1f fix(OneBotAdapter): 增加群角色缓存用于 get_group_member_info 超时降级,减少全群禁言情况下获取 info 超时情况下管理员身份被错判而跳过分析和发送的情况 2026-07-10 14:59:43 +08:00
SXP-Simon a42e876ef8 fix(call_provider_with_retry): 只有 primary provider 全部重试失败后,才会出现第二组 fallback 的 Provider 选择日志,减少不必要的日志内容 (e53016e) 2026-07-10 14:41:06 +08:00
Helian Nuits e8af00e016 feat(muted): 被禁言避免触发分析功能浪费 token (#191) (#203)
* feat(AnalysisApplicationService): 增加针对禁言的优化

* fix: 优先从 Event 中提取 bot_self_id

* fix: 禁言异常处理

* fix: 不传递 no_cache=True 以免超时

* fix: 如果 bot_instance 没变,且已经有适配器,跳过重新创建,防止丢失内部状态

* fix: set_reaction 方法操作异常拦截

* fix: 修复错误的禁言发送消息,改为日志提示

* chore: add .tmp_refs to .gitignore

* refactor(onebot): optimize and prune group mute cache

* fix(onebot): resolve pylance type mismatch warning in min key

* fix(onebot): annotate params dict with precise union type to resolve pylance warning
2026-07-08 11:44:19 +08:00
e53016eb01 feat(llm): 重构并优化模型请求的重试与降级补偿机制 (#195)
* refactor: optimize LLM fallback strategy using a unified attempt queue (Strategy B)

* refactor: apply exponential backoff, fix format state bleeding, and update typing to Any

* fix: avoid false breaker failures in LLM fallback

* style: format llm_utils.py with ruff

* fix: resolve possibly unbound variable warning in llm_utils.py

* refactor: replace loose Any type annotations with precise Context, ConfigManager, JSONValue, and LLMResponse

* docs: update call_provider_with_retry docstring and timeout comments

---------

Co-authored-by: Rat0323 <261020116+Rat0323@users.noreply.github.com>
Co-authored-by: SXP-Simon <sxp20061207@163.com>
2026-07-08 11:28:16 +08:00
d5b0c26289 fix(path): pass plugin name to StarTools.get_data_dir() to avoid inspect.stack() crash (#193)
* fix: pass plugin name to StarTools.get_data_dir to avoid inspect-stack crash

* refactor: reuse plugin name constant for data dir

---------

Co-authored-by: Rat0323 <rat0323@users.noreply.github.com>
Co-authored-by: Rat0323 <261020116+Rat0323@users.noreply.github.com>
2026-07-08 11:04:19 +08:00
SXP-Simon 27f0e9e838 [v4.10.6] - 支持 [SnowLuma](https://github.com/SnowLuma/SnowLuma) ,优化 HatsuneMiku 移动端适配情况 2026-05-23 16:46:35 +08:00
β-吲哚基丙氨酸awaandCopilot Autofix powered by AI 686d6a90f2 feat(onebot): Support Snowluma (#189)
* Update onebot_adapter.py

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-23 16:31:21 +08:00
Shiitin 8984f75c2f refactor(HatsuneMiku): 优化了移动端直接使用浏览器打开 HTML 时的 UI 排版情况 (#184)
* refactor:优化了移动端直接使用浏览器打开HTML时的UI

* feat:将所有模板中的base64编码图片转换为链接拉取以降低源文件大小
2026-05-09 20:20:55 +08:00
SXP-Simon 1a3d079535 [v4.10.5] - 支持可选流式 LLM 调用 (#181 @anchorAnc) 2026-05-01 18:37:44 +08:00
SXP-Simon 2d5585a47d refactor(json_utils): 重构JSON解析逻辑,提取通用方法并清理代码 2026-05-01 18:19:43 +08:00
Hengjie WangandSXP-Simon 83486de1d1 feat: 支持可选的流式 LLM 调用 (#181 @anchorAnc)
* feat: add optional streaming LLM provider call

* fix(llm_utils): code quality

---------

Co-authored-by: SXP-Simon <sxp20061207@163.com>
2026-05-01 18:17:43 +08:00
Helian Nuits fd51b4e399 fix(readme): readme 飞书接入情况说明
Updated Feishu / Lark integration section to indicate it is a work in progress.
2026-04-29 20:52:07 +08:00
SXP-Simon 9e0f88eeda [v4.10.4] - 🛠️ 将镜像地址配置注入到子模板渲染上下文中,解决 ATRI 子模板中变量未定义导致的生成问题 2026-04-27 17:12:29 +08:00
SXP-Simon 616d16010c fix(ATRI): 将镜像地址配置注入到子模板渲染上下文中,解决子模板中变量未定义导致的问题 2026-04-27 17:03:59 +08:00
SXP-Simon 09b4d188f2 fix(typo): T2I 文档 2026-04-26 21:22:50 +08:00
SXP-SimonandCopilot ec2249b9a7 [v4.10.3] - 优化报告模板中的头像与内联图片复用,并修复 Miku 峰值区块窄屏排版问题 (#178 @lekoOwO)
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 14:41:07 +08:00
leko 854b8c280a 优化报告模板中的头像与内联图片复用,并修复 Miku 峰值区块窄屏排版 (#178)
* refactor: 优化报告模板中的头像与内联图片复用,并修复 Miku 峰值区块窄屏排版

* refactor(avatar): improve avatar reference generation to enhance privacy by avoiding exposure of platform or user IDs
2026-04-26 14:36:14 +08:00
SXP-SimonandCopilot bb04114cdb [v4.10.2] - Telegram 头像处理修复,支持多地区渲染环境与自定义镜像
Co-authored-by: Copilot <copilot@github.com>
2026-04-25 12:35:18 +08:00
SXP-Simon 948bfb1b5b refactor(render): 解决国内可能存在的资源访问问题,新增大陆资源和海外资源可选项,允许用户根据服务器位置选择不同的资源策略,并且允许自定义资源镜像站
- Updated language attributes in HTML templates to dynamically set based on `t2i_font_source`.
- Replaced hardcoded Google Fonts links with dynamic links using `t2i_google_fonts_mirror` and `t2i_gstatic_mirror`.
- Adjusted font-family declarations to conditionally include 'Noto Sans SC' and 'Noto Sans TC' based on the `t2i_font_source`.
- Ensured consistent formatting and style across various templates including image, quote, topic, and user title items.
- Added missing newlines at the end of several files for consistency.
2026-04-25 12:22:36 +08:00
leko 54f517d3b0 fix(theme): 修復 HatsuneMiku 與 hack 主題在 HTML 模式的跑版,優化窄裝置版面並補強繁中字體 (#177)
* refactor: update HTML templates for Hatsune Miku reporting

- Changed language attribute from zh-CN to zh-Hant for better localization.
- Updated font links to include Traditional Chinese fonts (Noto Sans TC).
- Enhanced CSS styles for responsiveness and improved layout across various components.
- Added new classes for better structure and maintainability in quote, topic, and user title items.
- Adjusted styles for mobile view to ensure better usability and aesthetics.

* fix: update HTML templates for improved responsiveness and accessibility

* Refactor styles: Move CSS from image_template.html to shared_styles.html for better maintainability and organization

* fix: update font links and styles in HTML templates for consistency
2026-04-25 11:25:15 +08:00
leko 2618491246 fix: telegram avatar handling (#176)
* feat: add avatar caching support and improve error handling in Telegram adapter

* feat(avatar): implement avatar negative cache management and improve logging levels
2026-04-25 11:08:46 +08:00
SXP-Simon e48716dbf8 [v4.10.1] - 优化 T2I 渲染与自定义配置 2026-04-23 08:53:51 +08:00