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
This commit is contained in:
Helian Nuits
2026-07-08 11:44:19 +08:00
committed by GitHub
parent e53016eb01
commit e8af00e016
6 changed files with 301 additions and 20 deletions
+4
View File
@@ -535,6 +535,10 @@ class GroupDailyAnalysis(Star):
reason = result.get("reason")
if reason == "no_messages":
yield event.plain_result("❌ 未找到足够的群聊记录")
elif reason == "muted":
logger.warning(
f"{group_id} 开启了全群禁言或对 Bot 禁言,跳过回复以防抛出发送异常"
)
else:
yield event.plain_result("❌ 分析失败,原因未知")
return