Repository navigation
Typebot integration sends lid and not jid #2251
Description
Activity
I'm having this problem too
Mesmo problema aqui
Mesma coisa aqui!
PT: Eu resolvi com uma expressão no N8N, nela identifico se o remoteJid vem com @lid, se vier, utiliza o campo remoteJidAlt, se não vier e for @whatsapp.net ele passa o nó pra frente.
EN: I solve this using an expression in N8N. In it, I identify if the
remoteJidcomes with@lid. If it does, I use theremoteJidAltfield; if it doesn't and is@whatsapp.net, I pass the node to the next page.code:
{{ ( $('Webhook EVO').item.json.body.data.key.remoteJid.endsWith('@lid') ? $('Webhook EVO').item.json.body.data.key.remoteJidAlt : $('Webhook EVO').item.json.body.data.key.remoteJid ) .toString() .replace(/[\n\r\t ]+/g, '') }}Eu resolvi com uma expressão, nela identifico se o remoteJid vem com @lid, se vier, utiliza o campo remoteJidAlt, se não vier e for @whatsapp.net ele passa o nó pra frente.
Segue ccódigo:
{{ ( $('Webhook EVO').item.json.body.data.key.remoteJid.endsWith('@lid') ? $('Webhook EVO').item.json.body.data.key.remoteJidAlt : $('Webhook EVO').item.json.body.data.key.remoteJid ) .toString() .replace(/[\n\r\t ]+/g, '') }}this is possible with n8n, but here the problem is with typebot, it is not possible to do it since typebot only receives this data currently
const prefilledVariables = {
remoteJid: "JID of the contact",
pushName: "Contact's name",
instanceName: "Name of the instance",
serverUrl: "API server URL",
apiKey: "Evolution API key",
ownerJid: "JID of the number connected to the instance"
};Reacted by dujobi-contatoReacted by Fernando BolzanEstou com o mesmo problema
mesmo problema aqui
mesmo problema aqui
Mesmo problema aqui
Também… mesmo problema aqui!
Mesmo problema.
Reacted by dujobi-contatoEstou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver?
I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver?
I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?
Como você fez para resolver?
Estou com o mesmo problema, inicialmente utilizando o o typebot as mensagens do robô não iam por conta do @lid consegui corrigir isso porém com o "Stop bot from me" marcado, quando interajo com o cliente a sessão não muda para pausada, fica aberta e o robô continua atuando, alguém passou por isso e conseguiu resolver?
I'm having the same problem. Initially, using TypeBot, the bot's messages weren't going through because of the @lid attribute. I managed to fix that, but with "Stop bot from me" checked, when I interact with the client, the session doesn't change to paused; it stays open and the bot continues to act. Has anyone else experienced this and managed to solve it?Como você fez para resolver?
Fiz alteração no arquivo:
src/api/integrations/chatbot/base-chatbot.service.tsANTES:
number: remoteJid.split('@')[0]DEPOIS:
number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]Com isso o typebot passou a responder normalmente.
Lembra de rebuildar e reiniciar o EvolutionAPI depois.
2 remaining items
remoteJidAlt
Same problem here
I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
I had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
Funcionou! maravilha.
Obrigado. TanksI had the same issue. I downgraded to version v2.3.4 and the problem stopped happening.
What happened? You received jid for everyone? What do you mean the problem stopped happening
Obrigado @GustavoCPrado !
Aqui funcionou também!
Reacted by GustavoCPradono meu conteiner não tem esse arquivo, o mais perto que achei foi evolution/dist/api/integrations/chatbot
dentro dessa pasta tem varios arquivos mas nao tem esse base-chatbot.service.ts@srvelososantos, Dependendo da sua instalação... provavelmente no diretório /evolution/dist/api/integrations/chatbot do seu container, vai ver que tem alguns arquivos, semelhantes a este da imagem anexada.
Esse arquivo não aparece no container porque o build remove o código-fonte TypeScript. O .ts original está no repositório, não dentro do dist. No container só existe o resultado compilado/minificado, que vira vários bundles .js dentro de evolution/dist/api/integrations/chatbot. O base-chatbot.service.ts é transformado e incorporado nesses bundles, então ele deixa de existir como arquivo separado.
Você até consegue editar na mão o arquivo base-chatbot.service.js que seria o .js minificado do base-chatbot.service.ts, porém, isso não é recomendado e nada prático (Mas resolve, por um tempo). Melhor solução, na minha opinião, é tratar direto na imagem e depois subir para o hub e usar ela, para se caso, precisar parar ou recriar o container não ter que ficar editando esse arquivo novamente.
Eu só não entendi por onde que eu edito esse arquivo .ts, eu preciso clonar o repositório do evolution-api ?
Mesmo problema aqui! Quando o contato é @lid, simplesmente não identifica a resposta do cliente.
@GustavoCPrado Fiz a edição do parâmetro em todas as linhas que encontrei no base-chatbot.ts. Um exemplo ficou assim:
await new Promise((resolve) => {
setTimeout(async () => {
await instance.textMessage(
{
number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0],
delay: settings?.delayMessage || 1000,
text: message,
linkPreview,
},
false,
);
resolve();
}, delay);
});Rebuildei a imagem, subi pro HUB e fiz um novo Deploy.
Estou esquecendo de algo?
@willDullius eu fiz a mesma coisa, agr o numero pode aparecer ou na variável remoteJid ou remoteJidAlt do webhook, só tratar no seu código. Comigo ta dando certo agora.
Reacted by William DulliusMesmo problema aqui! Quando o contato é @lid, simplesmente não identifica a resposta do cliente.
@GustavoCPrado Fiz a edição do parâmetro em todas as linhas que encontrei no base-chatbot.ts. Um exemplo ficou assim:
await new Promise((resolve) => { setTimeout(async () => { await instance.textMessage( { number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0], delay: settings?.delayMessage || 1000, text: message, linkPreview, }, false, ); resolve(); }, delay); });
Rebuildei a imagem, subi pro HUB e fiz um novo Deploy.
Estou esquecendo de algo?
Lembrou de rebuildar e reiniciar o EvolutionAPI?
I saw a new version is released, with a suggested fix, hope the fix will work
Closing as duplicate of #1872 —
@lidhandling meta-issue (cross-cuts Typebot in this case).See #1872 for tracked symptoms and the Typebot umbrella is forthcoming.