Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def send_fb_message(to, message):
post_message_url = 'https://graph.facebook.com/v2.6/me/messages?access_token={token}'.format(token=config.FB_TOKEN)
response_message = json.dumps({"recipient":{"id": to},
"message":{"text":message}})
req = requests.post(post_message_url,
headers={"Content-Type": "application/json"},
data=response_message)
print("[{}] Reply to {}: {}", req.status_code, to, message)
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.