From 830fb08a7cf87af1fa22ad08becefa5ba34b5342 Mon Sep 17 00:00:00 2001 From: Gary Barbon Date: Tue, 14 Sep 2021 10:26:32 -0700 Subject: [PATCH] Added a handler for message echoes Summary: Bot was failing when receiving the Echo webhook. This corrects it. Reviewed By: Riandy Differential Revision: D30933961 fbshipit-source-id: 34c2b68409ee2a7cc57a1feed8d9f67f11e90287 --- app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.js b/app.js index f767e8c..56fe5c5 100644 --- a/app.js +++ b/app.js @@ -112,6 +112,9 @@ app.post("/webhook", (req, res) => { } else if ("delivery" in webhookEvent) { console.log("Got a delivery event"); return; + } else if (webhookEvent.message && webhookEvent.message.is_echo) { + console.log("Got an echo of our send, mid = " + webhookEvent.message.mid); + return; } // Get the sender PSID