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
@@ -149,6 +149,8 @@ function describeError(error) {
|
||||
async function onMessage(event) {
|
||||
try {
|
||||
const config = await loadConfig()
|
||||
// 交给自动化规则处理时,订阅路径必须彻底闭嘴,否则同一条消息回复两次。
|
||||
if (config.executionMode === 'automation') return
|
||||
const now = Date.now()
|
||||
const verdict = shouldReply(event, config, cooldownUntil, now)
|
||||
if (!verdict.reply || !verdict.rule) return
|
||||
@@ -198,6 +200,10 @@ module.exports = function activate(api) {
|
||||
if (!config.enabled) {
|
||||
return { success: false, error: '机器人未启用' }
|
||||
}
|
||||
// 订阅模式下这条路径同样会发送:直接跳过,避免与事件路径重复回复。
|
||||
if (config.executionMode === 'subscribe') {
|
||||
return { success: true, output: { matched: false, skipped: 'subscribe-mode' } }
|
||||
}
|
||||
const rule = pickRule(input.text, config)
|
||||
if (!rule) {
|
||||
return { success: true, output: { matched: false } }
|
||||
|
||||
Reference in new issue
Block a user