feat: 退群监控接入自动化能力统一管理, 支持发送个人/文件传输助手/指定群聊

This commit is contained in:
Wxw-Gu committed 2026-09-24 16:31:07 +08:00
1 parent 3bd3935042
commit 59872daf52
43 files changed
+5661 -1132

No files matched your search

+10
View File
@@ -32,6 +32,7 @@ export interface AutomationMatchInput {
}
export type AutomationMatchFailure =
| 'rule_type'
| 'disabled'
| 'self'
| 'scope'
@@ -52,6 +53,15 @@ export function matchAutomationRule(
/** 自己的 username 候选集(`getMyUsernameCandidates()`)。 */
selfUsernames: readonly string[]
): AutomationMatchResult {
// **规则类型闸门放在最前面。**
//
// 「退群通知」的空关键词 + 不要求 @我,会让它命中**每一条群消息** ——
// 那是最坏的一类 bug:用户什么都没配,规则却开始乱跑。
// 类型分派必须在这里一处解决,预览与真实执行才会一致。
if (rule.ruleType === 'leave_notification') {
return { matched: false, reason: 'rule_type' }
}
if (!rule.enabled) return { matched: false, reason: 'disabled' }
// 防死循环第一道闸:自己发的消息默认不触发。