Closed vidz1979 closed 2 years ago
da uma olhada no LOG do Docker pra ver o que ele está acusando....
da também uma verificada no CLIENT do Whatsapp: De 2 cliques no nó principal do whatsapp e clica pra editar o client, la é pra ter o diretorio onde vai salvar os dados.
O diretorio está apontando pro data/whatsapp. Dentro de contacts tem o json do meu contato de teste: {"lastNodeId":"c235a9cab58449b5"}. O último nó é a pergunta do nome, então acho que tá tudo ok aqui.
Porém no log do docker tem um erro (falta de um módulo - não sei se é esse o problema):
{"level":20,"time":1657650939413,"pid":17,"hostname":"8da033c848e3","attrs":{"id":"3EB0634824931911F3B8","to":"556592054852:40@s.whatsapp.net"},"messageIds":["3EB0634824931911F3B8"],"msg":"sending receipt for messages"} parsed message type conversation Message { conversation: 'Ola', messageContextInfo: MessageContextInfo { deviceListMetadata: DeviceListMetadata { senderKeyIndexes: [], recipientKeyIndexes: [], senderKeyHash: [Uint8Array], senderTimestamp: [Long], recipientKeyHash: [Uint8Array], recipientTimestamp: [Long] }, deviceListMetadataVersion: 2 } } chats.update [ { id: '556592054852@s.whatsapp.net', conversationTimestamp: 1657650939, unreadCount: 1 } ] contacts.update [ { id: '556592054852@s.whatsapp.net', notify: 'Junior' } ] {"level":20,"time":1657650939417,"pid":17,"hostname":"8da033c848e3","attrs":{"id":"3EB0634824931911F3B8","t":"1657650939","to":"556592054852@s.whatsapp.net","participant":"556592054852@s.whatsapp.net","type":"read"},"messageIds":["3EB0634824931911F3B8"],"msg":"sending receipt for messages"} {"level":20,"time":1657650939630,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"3EB0634824931911F3B8","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"receipt","type":"read","id":"3EB0634824931911F3B8","participant":"556592054852@s.whatsapp.net"}},"msg":"communication recv"} {"level":40,"time":1657650940289,"pid":17,"hostname":"8da033c848e3","trace":"Error: Cannot find module 'link-preview-js'\nRequire stack:\n- /data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js\n- /data/node_modules/@adiwajshing/baileys/lib/Utils/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/Defaults/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/index.js\n- /data/node_modules/node-red-contrib-kore-whatsappbot/whatsapp-client.js\n- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js\n- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js\n- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js\n- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js\n- /usr/src/node-red/node_modules/node-red/lib/red.js\n- /usr/src/node-red/node_modules/node-red/red.js\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)\n at Function.Module._load (internal/modules/cjs/loader.js:746:27)\n at Module.require (internal/modules/cjs/loader.js:974:19)\n at require (internal/modules/cjs/helpers.js:93:18)\n at /data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js:43:84\n at async getUrlInfo (/data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js:43:36)\n at async generateLinkPreviewIfRequired (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:37:29)\n at async generateWAMessageContent (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:197:23)\n at async generateWAMessage (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:394:59)\n at async Object.sendMessage (/data/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:464:33)","msg":"url generation failed"} {"level":20,"time":1657650940718,"pid":17,"hostname":"8da033c848e3","jid":"556592054852@s.whatsapp.net","msg":"adding device identity"} {"level":20,"time":1657650940718,"pid":17,"hostname":"8da033c848e3","msgId":"BAE5B50015C55B64","msg":"sending message to 5 devices"} parsed message type extendedTextMessage Message { extendedTextMessage: ExtendedTextMessage { text: 'Olá, seja bem-vindo a Kore.AG' } } chats.update [ { id: '556592054852@s.whatsapp.net', conversationTimestamp: 1657650940 } ] {"level":20,"time":1657650940939,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"BAE5B50015C55B64","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"message","id":"BAE5B50015C55B64","t":"1657650940"}},"msg":"communication recv"} {"level":20,"time":1657650941112,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556530562032@s.whatsapp.net","id":"3EB0634824931911F3B8","recipient":"556592054852@s.whatsapp.net","t":"1657650940"}},"sent":{"id":"3EB0634824931911F3B8","to":"556530562032@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} {"level":20,"time":1657650941224,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556530562032@s.whatsapp.net","type":"sender","id":"BAE5B50015C55B64","recipient":"556592054852@s.whatsapp.net","t":"1657650940"}},"sent":{"id":"BAE5B50015C55B64","to":"556530562032@s.whatsapp.net","class":"receipt","type":"sender"},"msg":"sent ack"} status { key: { remoteJid: '556592054852@s.whatsapp.net', id: 'BAE5B50015C55B64', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650941235,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852@s.whatsapp.net","id":"BAE5B50015C55B64","t":"1657650940"}},"sent":{"id":"BAE5B50015C55B64","to":"556592054852@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} status { key: { remoteJid: '556592054852:40@s.whatsapp.net', id: 'BAE5B50015C55B64', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650941239,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852:40@s.whatsapp.net","id":"BAE5B50015C55B64","t":"1657650940"}},"sent":{"id":"BAE5B50015C55B64","to":"556592054852:40@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} {"level":20,"time":1657650941294,"pid":17,"hostname":"8da033c848e3","attrs":{"id":"3EB0634824931911F3B8","t":"1657650941","to":"556592054852@s.whatsapp.net","participant":"556592054852@s.whatsapp.net","type":"read"},"messageIds":["3EB0634824931911F3B8"],"msg":"sending receipt for messages"} {"level":20,"time":1657650941508,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"3EB0634824931911F3B8","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"receipt","type":"read","id":"3EB0634824931911F3B8","participant":"556592054852@s.whatsapp.net"}},"msg":"communication recv"} {"level":40,"time":1657650943425,"pid":17,"hostname":"8da033c848e3","trace":"Error: Cannot find module 'link-preview-js'\nRequire stack:\n- /data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js\n- /data/node_modules/@adiwajshing/baileys/lib/Utils/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/Defaults/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js\n- /data/node_modules/@adiwajshing/baileys/lib/index.js\n- /data/node_modules/node-red-contrib-kore-whatsappbot/whatsapp-client.js\n- /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js\n- /usr/src/node-red/node_modules/@node-red/registry/lib/index.js\n- /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js\n- /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js\n- /usr/src/node-red/node_modules/node-red/lib/red.js\n- /usr/src/node-red/node_modules/node-red/red.js\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)\n at Function.Module._load (internal/modules/cjs/loader.js:746:27)\n at Module.require (internal/modules/cjs/loader.js:974:19)\n at require (internal/modules/cjs/helpers.js:93:18)\n at /data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js:43:84\n at async getUrlInfo (/data/node_modules/@adiwajshing/baileys/lib/Utils/link-preview.js:43:36)\n at async generateLinkPreviewIfRequired (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:37:29)\n at async generateWAMessageContent (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:197:23)\n at async generateWAMessage (/data/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:394:59)\n at async Object.sendMessage (/data/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:464:33)","msg":"url generation failed"} {"level":20,"time":1657650943814,"pid":17,"hostname":"8da033c848e3","jid":"556592054852@s.whatsapp.net","msg":"adding device identity"} {"level":20,"time":1657650943814,"pid":17,"hostname":"8da033c848e3","msgId":"BAE5803ED8BE21A8","msg":"sending message to 5 devices"} parsed message type extendedTextMessage Message { extendedTextMessage: ExtendedTextMessage { text: 'Eu sou o assistente virtual aqui da Kore.AG, e vou te guiar por aqui...' } } chats.update [ { id: '556592054852@s.whatsapp.net', conversationTimestamp: 1657650943 } ] {"level":20,"time":1657650944032,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"BAE5803ED8BE21A8","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"message","id":"BAE5803ED8BE21A8","t":"1657650943"}},"msg":"communication recv"} status { key: { remoteJid: '556592054852:40@s.whatsapp.net', id: 'BAE5803ED8BE21A8', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650944328,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852:40@s.whatsapp.net","id":"BAE5803ED8BE21A8","t":"1657650944"}},"sent":{"id":"BAE5803ED8BE21A8","to":"556592054852:40@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} {"level":20,"time":1657650944428,"pid":17,"hostname":"8da033c848e3","attrs":{"id":"3EB0634824931911F3B8","t":"1657650944","to":"556592054852@s.whatsapp.net","participant":"556592054852@s.whatsapp.net","type":"read"},"messageIds":["3EB0634824931911F3B8"],"msg":"sending receipt for messages"} {"level":20,"time":1657650944449,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556530562032@s.whatsapp.net","type":"sender","id":"BAE5803ED8BE21A8","recipient":"556592054852@s.whatsapp.net","t":"1657650944"}},"sent":{"id":"BAE5803ED8BE21A8","to":"556530562032@s.whatsapp.net","class":"receipt","type":"sender"},"msg":"sent ack"} status { key: { remoteJid: '556592054852@s.whatsapp.net', id: 'BAE5803ED8BE21A8', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650944454,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852@s.whatsapp.net","id":"BAE5803ED8BE21A8","t":"1657650944"}},"sent":{"id":"BAE5803ED8BE21A8","to":"556592054852@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} {"level":20,"time":1657650944642,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"3EB0634824931911F3B8","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"receipt","type":"read","id":"3EB0634824931911F3B8","participant":"556592054852@s.whatsapp.net"}},"msg":"communication recv"} {"level":20,"time":1657650946208,"pid":17,"hostname":"8da033c848e3","jid":"556592054852@s.whatsapp.net","msg":"adding device identity"} {"level":20,"time":1657650946208,"pid":17,"hostname":"8da033c848e3","msgId":"BAE5F4B9D8E1D5B9","msg":"sending message to 5 devices"} parsed message type extendedTextMessage Message { extendedTextMessage: ExtendedTextMessage { text: 'Bom, pra começar, que tal me dizer o seu nome?' } } chats.update [ { id: '556592054852@s.whatsapp.net', conversationTimestamp: 1657650945 } ] {"level":20,"time":1657650946426,"pid":17,"hostname":"8da033c848e3","unhandled":true,"msgId":"BAE5F4B9D8E1D5B9","fromMe":false,"frame":{"tag":"ack","attrs":{"from":"556592054852@s.whatsapp.net","class":"message","id":"BAE5F4B9D8E1D5B9","t":"1657650946"}},"msg":"communication recv"} status { key: { remoteJid: '556592054852:40@s.whatsapp.net', id: 'BAE5F4B9D8E1D5B9', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650946725,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852:40@s.whatsapp.net","id":"BAE5F4B9D8E1D5B9","t":"1657650946"}},"sent":{"id":"BAE5F4B9D8E1D5B9","to":"556592054852:40@s.whatsapp.net","class":"receipt"},"msg":"sent ack"} {"level":20,"time":1657650946763,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556530562032@s.whatsapp.net","type":"sender","id":"BAE5F4B9D8E1D5B9","recipient":"556592054852@s.whatsapp.net","t":"1657650946"}},"sent":{"id":"BAE5F4B9D8E1D5B9","to":"556530562032@s.whatsapp.net","class":"receipt","type":"sender"},"msg":"sent ack"} status { key: { remoteJid: '556592054852@s.whatsapp.net', id: 'BAE5F4B9D8E1D5B9', fromMe: true, participant: undefined }, update: { status: 3 } } {"level":20,"time":1657650946767,"pid":17,"hostname":"8da033c848e3","recv":{"tag":"receipt","attrs":{"from":"556592054852@s.whatsapp.net","id":"BAE5F4B9D8E1D5B9","t":"1657650946"}},"sent":{"id":"BAE5F4B9D8E1D5B9","to":"556592054852@s.whatsapp.net","class":"receipt"},"msg":"sent ack"}
PS: Instalei o link-preview-js manualmente e passou a funcionalidade do link preview está ok, mas ainda não está iniciando o bot a partir da último node acessado.
Acho que pode ter ocorrido uma falha no PR de ontem, que saltou da 0.2.22 pra 0.2.29, porém um arquivo não foi atualizado:
Assim, a linha:
const sessionDir = "/data/sessions/"+clientNode.id+"-"+id.split("@")[0]+".json";
Deve ficar:
const sessionDir = clientNode.storage + "/contacts/" + id.split("@")[0] + ".json";
Mas talvez há mais alterações que possam ter ficado pra trás nesse bump de versão.
Comparei o arquivo com a versão 0.2.28 e realmente é só aquilo que estava fora. Fiz um PR para resolver isso (https://github.com/riccefarias/node-red-contrib-kore-whatsappbot/pull/5).
Opa, showw to liberando já
Estou testando o Flow de exemplo, e quando pede o nome o flow é reiniciado. Estou usando uma instalação nova do Node-RED (docker) e a última versão do whatsappbot (0.2.29):