How can I save messages from my facebook webhook to a textfile using python and django. The code is attached below

if 'message' in message:
    # Print the message to the terminal
    print(message)
    # Assuming the sender only sends text. Non-text messages like stickers, audio, pictures
    # are sent as attachments and must be handled accordingly.
    print(message['message']['text'])
    respondinging = input("enter response")
    post_facebook_message(message['sender']['id'], respondinging)

    return HttpResponse()
Back to Top