daveebbelaar / python-whatsapp-bot

Build AI WhatsApp Bots with Pure Python
https://www.datalumina.com
MIT License
520 stars 333 forks source link

Update views.py #2

Open aziliak opened 7 months ago

aziliak commented 7 months ago

views.py

Change the end to the following. I commented out the original code and got the verification to work. I was getting a 403 error before.

@webhook_blueprint.route("/webhook", methods=["GET"]) def webhook_get(): return verify()

@webhook_blueprint.route("/webhook", methods=["POST"]) @signature_required def webhook_post(): return handle_message() """ @webhook_blueprint.route("/webhook", methods=["POST", "GET"]) @signature_required def webhook(): if request.method == "GET": return verify() elif request.method == "POST": return handle_message() """