From 021737ad1622896b7f98b3ceb330592f2be5efb1 Mon Sep 17 00:00:00 2001 From: Lili Date: Mon, 27 Mar 2023 14:24:35 +0200 Subject: [PATCH] check if user has all the points they're sending --- tlapbot/redeems_handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tlapbot/redeems_handler.py b/tlapbot/redeems_handler.py index d320b3d..0c13657 100644 --- a/tlapbot/redeems_handler.py +++ b/tlapbot/redeems_handler.py @@ -56,6 +56,8 @@ def handle_redeem(message, user_id): send_chat(f"Cannot redeem {redeem}, amount of points is not an integer.") elif int(note) < price: send_chat(f"Can't redeem {redeem}, your donation is below the minimum bid of {price}.") + elif int(note) < points: + send_chat(f"Can't redeem {redeem}, you're donating more points than you have.") elif add_to_milestone(db, user_id, redeem, int(note)): send_chat(f"Succesfully donated to {redeem} milestone!") if check_apply_milestone_completion(db, redeem):