INNER CODE UNIT · Python
facebook_message_handler
opsdroid/opsdroid · opsdroid/connector/facebook/__init__.py:55
async def facebook_message_handler(self, request):
"""Handle incoming message.
For each entry in request, it will check if the entry is a `messaging`
type. Then it will process all the incoming messages.
Return:
A 200 OK response. The Messenger Platform will resend the webhook
event every 20 seconds, until a 200 OK response is received.
Failing to return a 200 OK may cause your webhook to be
unsubscribed by the Messenger Platform.
"""
req_data = await request.json()
if "object" in req_data and req_data["object"] == "page":
for entry in req_data["entry"]:
for fb_msg in entry["messaging"]: