From b520d0d8b27775e44584768a5c9ee10f1c799123 Mon Sep 17 00:00:00 2001 From: Ben Arc Date: Tue, 20 Apr 2021 09:35:32 +0100 Subject: [PATCH] included some checks for the thresholds --- lnbits/extensions/copilot/tasks.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/lnbits/extensions/copilot/tasks.py b/lnbits/extensions/copilot/tasks.py index 0dfb8986..5407135b 100644 --- a/lnbits/extensions/copilot/tasks.py +++ b/lnbits/extensions/copilot/tasks.py @@ -40,24 +40,18 @@ async def on_invoice_paid(payment: Payment) -> None: jsonify({"message": "Copilot link link does not exist."}), HTTPStatus.NOT_FOUND, ) - if ( - int(copilot.animation1threshold) - and int(payment.amount) > copilot.animation1threshold - ): - data = copilot.animation1 - webhook = copilot.animation1webhook - if ( - int(copilot.animation2threshold) - and int(payment.amount) > copilot.animation2threshold - ): - data = copilot.animation2 + if copilot.animation1threshold: + if int(payment.amount) > copilot.animation1threshold: + data = copilot.animation1 webhook = copilot.animation1webhook - if ( - int(copilot.animation3threshold) - and int(payment.amount) > copilot.animation3threshold - ): - data = copilot.animation3 + if copilot.animation2threshold: + if int(payment.amount) > copilot.animation2threshold: + data = copilot.animation2 webhook = copilot.animation1webhook + if copilot.animation3threshold: + if int(payment.amount) > copilot.animation3threshold: + data = copilot.animation3 + webhook = copilot.animation1webhook if webhook: async with httpx.AsyncClient() as client: try: