Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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
You can’t perform that action at this time.