Search code examples
facebookfacebook-messengerchatbotfacebook-chatbot

I am getting a echo of my sent message in Facebook Messenger bot


I am sending a message and then getting the echo of the same message being returned.

Webhook received unknown event:  { sender: { id: '1863694633952475' },
  recipient: { id: '1634553643235404' },
  timestamp: 1497369088523,
  message:
   { is_echo: true,
     app_id: 402378593495528,
     mid: 'mid.$cAAafBWtBTQBi02xaC1coicRsq706',
     seq: 165837,
     text: 'Hey Wassup?' } }
Webhook received unknown event:  { sender: { id: '1634553643235404' },
  recipient: { id: '1863694633952475' },
  timestamp: 1497369088953,
  delivery:
   { mids: [ 'mid.$cAAafBWtBTQBi02xaC1coicRsq706' ],
     watermark: 1497369088523,
     seq: 0 } }
Webhook received unknown event:  { sender: { id: '1634553643235404' },
  recipient: { id: '1863694633952475' },
  timestamp: 1497369089474,
  delivery:
   { mids: [ 'mid.$cAAafBWtBTQBi02xaC1coicRsq706' ],
     watermark: 1497369088523,
     seq: 0 } }

I am sending the message

Hey, Wassup!

whenever i get any message. Why is it getting echoed back? Is there any way to stop that echo. And also why am i getting two delivery events on my webhook?

I am using nodejs with express as my server.


Solution

  • Check your facebook messenger webhook subscriptions.

    Facebook Messenger Webhook Events docs

    Turn off the echoes event, and anything you arent explicitly using. Typically only messages, optins, postbacks, and referral events are used.

    The echo event is triggering your code twice.