feat(secretaria): kill-switch do auto-reply (secretaria.auto_reply=false)
Bloqueia SÓ o disparo automático da Secretária (envios manuais seguem normais). Só desliga quando a config é explicitamente false — sem a flag, inalterado. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,12 @@ function buildExtRoutes(prisma, manager, db, config, hooks, io) {
|
|||||||
// NUNCA responde em grupos (@g.us): a Secretária é atendimento 1:1.
|
// NUNCA responde em grupos (@g.us): a Secretária é atendimento 1:1.
|
||||||
if (jid.endsWith('@g.us'))
|
if (jid.endsWith('@g.us'))
|
||||||
return;
|
return;
|
||||||
|
// Kill-switch do auto-reply: secretaria.auto_reply === false desliga SÓ o
|
||||||
|
// disparo automático da Secretária (envios manuais seguem normais). Só
|
||||||
|
// bloqueia quando explicitamente false — sem a flag, comportamento inalterado.
|
||||||
|
const secCfg = (await config.get('secretaria'));
|
||||||
|
if (secCfg?.auto_reply === false)
|
||||||
|
return;
|
||||||
// Exclusão mútua: chatbot rápido tem prioridade se estiver ativo
|
// Exclusão mútua: chatbot rápido tem prioridade se estiver ativo
|
||||||
const activeBot = await prisma.aIBot.findFirst({ where: { tenantId, instanceId, enabled: true } });
|
const activeBot = await prisma.aIBot.findFirst({ where: { tenantId, instanceId, enabled: true } });
|
||||||
if (activeBot)
|
if (activeBot)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -123,6 +123,12 @@ export function buildExtRoutes(
|
|||||||
// NUNCA responde em grupos (@g.us): a Secretária é atendimento 1:1.
|
// NUNCA responde em grupos (@g.us): a Secretária é atendimento 1:1.
|
||||||
if (jid.endsWith('@g.us')) return
|
if (jid.endsWith('@g.us')) return
|
||||||
|
|
||||||
|
// Kill-switch do auto-reply: secretaria.auto_reply === false desliga SÓ o
|
||||||
|
// disparo automático da Secretária (envios manuais seguem normais). Só
|
||||||
|
// bloqueia quando explicitamente false — sem a flag, comportamento inalterado.
|
||||||
|
const secCfg = (await config.get('secretaria')) as any
|
||||||
|
if (secCfg?.auto_reply === false) return
|
||||||
|
|
||||||
// Exclusão mútua: chatbot rápido tem prioridade se estiver ativo
|
// Exclusão mútua: chatbot rápido tem prioridade se estiver ativo
|
||||||
const activeBot = await prisma.aIBot.findFirst({ where: { tenantId, instanceId, enabled: true } })
|
const activeBot = await prisma.aIBot.findFirst({ where: { tenantId, instanceId, enabled: true } })
|
||||||
if (activeBot) return
|
if (activeBot) return
|
||||||
|
|||||||
Reference in New Issue
Block a user