INNER CODE UNIT · Python
connect
opsdroid/opsdroid · opsdroid/connector/facebook/__init__.py:45
async def connect(self):
"""Connect to the chat service."""
self.opsdroid.web_server.web_app.router.add_post(
"/connector/{}".format(self.name), self.facebook_message_handler
)
self.opsdroid.web_server.web_app.router.add_get(
"/connector/{}".format(self.name), self.facebook_challenge_handler
)
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