Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Added a handler for message echoes
Browse files Browse the repository at this point in the history
Summary: Bot was failing when receiving the Echo webhook. This corrects it.

Reviewed By: Riandy

Differential Revision: D30933961

fbshipit-source-id: 34c2b68409ee2a7cc57a1feed8d9f67f11e90287
  • Loading branch information
Barbog authored and facebook-github-bot committed Sep 14, 2021
1 parent fece6e4 commit 830fb08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 830fb08

@Barbog
Copy link
Contributor Author

@Barbog Barbog commented on 830fb08 Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarn linter complaining about white space. Not going to worry about it. Will re-format the file later.

Please sign in to comment.