Created
May 17, 2018 23:41
-
-
Save enginebai/f98a79663d260bb7e5ad96bb4550e531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route(API_ROOT + FB_WEBHOOK, methods=['POST']) | |
def fb_receive_message(): | |
message_entries = json.loads(request.data.decode('utf8'))['entry'] | |
for entry in message_entries: | |
for message in entry['messaging']: | |
if message.get('message'): | |
print("{sender[id]} says {message[text]}".format(**message)) | |
return "Hi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment