mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 拓展中心
This commit is contained in:
1 parent
9ffa1efc26
commit
4eaddc2d75
74 files changed
+11738
-379
No files matched your search
@@ -20,6 +20,15 @@ const MAX_GROUPS = 200
|
||||
|
||||
const MODES = new Set(['contains', 'exact', 'prefix'])
|
||||
|
||||
/**
|
||||
* 两条回复入口的执行模式。
|
||||
*
|
||||
* 同一条消息若同时被「事件订阅」和「自动化动作」处理,会回复两次。
|
||||
* 这里用互斥模式从根上避免:默认保留订阅(兼容旧用户),
|
||||
* 切到 `automation` 后订阅路径完全不再发送。
|
||||
*/
|
||||
const EXECUTION_MODES = new Set(['subscribe', 'automation'])
|
||||
|
||||
/**
|
||||
* 把任意来源的配置规范化为 `configVersion: 2`。
|
||||
*
|
||||
@@ -49,6 +58,7 @@ function normalizeConfig(raw) {
|
||||
return {
|
||||
configVersion: CONFIG_VERSION,
|
||||
enabled: input.enabled === true,
|
||||
executionMode: EXECUTION_MODES.has(input.executionMode) ? input.executionMode : 'subscribe',
|
||||
rules,
|
||||
scope: {
|
||||
groups: Array.isArray(scope.groups)
|
||||
@@ -204,6 +214,7 @@ function clampNumber(value, min, max) {
|
||||
|
||||
module.exports = {
|
||||
CONFIG_VERSION,
|
||||
EXECUTION_MODES,
|
||||
normalizeConfig,
|
||||
matchRule,
|
||||
pickRule,
|
||||
|
||||
Reference in new issue
Block a user