Make hook lookup workx

This commit is contained in:
Guy Van Sanden 2025-02-04 17:41:05 +01:00
parent d577758fce
commit 447361ace7

View File

@ -41,9 +41,15 @@ def webhook_receiver(id):
# Process the data and perform actions based on the event
print("Received webhook data:", data)
target = hooks.get(id)
print(target)
sendmessage(target, data.get('message'))
target = None
for key, value in hooks.items():
print("%s/%s" % (str(key), str(id)))
if key == id:
target = value
if target is not None:
print(target)
sendmessage(target, data.get('message'))
return jsonify({'message': 'Webhook received successfully'}), 200