From b573cdeee701440d6490b0b582bd6a1f33b6214d Mon Sep 17 00:00:00 2001 From: Yitzhack Yitzhack <45077431+AnubisXHyperX@users.noreply.github.com> Date: Sat, 30 Dec 2023 00:31:44 +0200 Subject: [PATCH] Update views.py --- app/views.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views.py b/app/views.py index 83bf6e13..503e9885 100644 --- a/app/views.py +++ b/app/views.py @@ -77,10 +77,13 @@ def verify(): return jsonify({"status": "error", "message": "Missing parameters"}), 400 -@webhook_blueprint.route("/webhook", methods=["POST", "GET"]) +@webhook_blueprint.route("/webhook", methods=["GET"]) +def webhook_get(): + return verify() + +@webhook_blueprint.route("/webhook", methods=["POST"]) @signature_required -def webhook(): - if request.method == "GET": - return verify() - elif request.method == "POST": - return handle_message() +def webhook_post(): + return handle_message() + +