Estou fazendo um bot para testar a ferramenta usando o SDK em JS.
Quando eu mando uma mensagem para o cliente utilizando sendMessage
, se a mensagem é enviada para o BLiP Chat (ou a área de teste), tudo ocorre do jeito esperado.
Porém, se a mensagem vai para o Messenger, a notification “received” vem com um ID diferente do da mensagem que eu enviei, e duas vezes.
As messages que estou enviando seguem o modelo
{ id, type: 'text/plain', to: message.from, content: '(texto simples)' }
Logs abaixo. ID da mensagem enviada está como ID: …, logo em baixo da received.
Esperado:
Starting dialog
Message received: {"type":"text/plain","content":"oi","id":"143ecd6c-9cae-424b-840a-6571c8a171a0","from":"79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default","to":"[email protected]","metadata":{"date_created":"1567620884220"}}
ID: 8c785efb-6b4a-47c0-8450-7bd0f92c611c
NOTIFICATION: { event: 'accepted',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to':
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default' } }
NOTIFICATION: { event: 'dispatched',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to':
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default' } }
NOTIFICATION: { event: 'accepted',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to':
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default',
'#channel.preserveClaims': 'True' } }
NOTIFICATION: { event: 'dispatched',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to':
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default',
'#channel.preserveClaims': 'True' } }
NOTIFICATION: { event: 'consumed',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from:
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default',
to: '[email protected]/default' }
NOTIFICATION: { event: 'received',
id: '8c785efb-6b4a-47c0-8450-7bd0f92c611c',
from:
'79f026d1-6fb1-46ec-ad7f-0f6950c2c51e.tutorialfilialbrasil1@0mn.io/default',
to: '[email protected]/default' }
"Greeting" sent
Messenger:
Starting dialog
Message received: {"type":"text/plain","content":"oi","id":"2dc2bbf7-55a2-4cd3-b123-d57f00bfebd6","from":"[email protected]","to":"[email protected]","metadata":{"messenger.mdi":"5SoIBPTRb4uZFqjCdXNdGcGnPdXTSXSNpKCZ620iElH39kZpXtESBCRQvTNVnxTYx0UagvnEyWlBNFQ7ThRwfA","messenger.seq":null}}
ID: e10412f8-bdbc-4e02-948b-887460021c62
NOTIFICATION: { event: 'accepted',
id: 'e10412f8-bdbc-4e02-948b-887460021c62',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to': '[email protected]' } }
NOTIFICATION: { event: 'dispatched',
id: 'e10412f8-bdbc-4e02-948b-887460021c62',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to': '[email protected]' } }
NOTIFICATION: { event: 'accepted',
id: 'e10412f8-bdbc-4e02-948b-887460021c62',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to': '[email protected]' } }
NOTIFICATION: { event: 'dispatched',
id: 'e10412f8-bdbc-4e02-948b-887460021c62',
from: '[email protected]/#az-iris2',
to: '[email protected]/default',
metadata:
{ '#message.to': '[email protected]' } }
NOTIFICATION: { event: 'received',
id: '7140c7a3-0973-4bcc-bb66-9d923bcee890',
from: '[email protected]',
to: '[email protected]/default',
metadata:
{ 'messenger.watermark': '1567621026345',
'messenger.seq': null } }
NOTIFICATION: { event: 'received',
id: '7140c7a3-0973-4bcc-bb66-9d923bcee890',
from: '[email protected]',
to: '[email protected]/default',
metadata:
{ 'messenger.watermark': '1567621026345',
'messenger.seq': null } }