fix taking away points when no note with note rdm
This commit is contained in:
parent
15dfd3ccae
commit
a667f746f3
|
@ -18,16 +18,18 @@ def handle_redeem(message, user_id):
|
|||
redeem_type = current_app.config['REDEEMS'][redeem]["type"]
|
||||
points = read_users_points(db, user_id)
|
||||
if points is not None and points >= price:
|
||||
if use_points(db, user_id, price):
|
||||
if redeem_type == "counter":
|
||||
add_to_counter(db, redeem)
|
||||
use_points(db, user_id, price)
|
||||
send_chat(f"{redeem} redeemed for {price} points.")
|
||||
elif redeem_type == "list":
|
||||
add_to_redeem_queue(db, user_id, redeem)
|
||||
use_points(db, user_id, price)
|
||||
send_chat(f"{redeem} redeemed for {price} points.")
|
||||
elif redeem_type == "note":
|
||||
if note is not None:
|
||||
add_to_redeem_queue(db, user_id, redeem, note)
|
||||
use_points(db, user_id, price)
|
||||
send_chat(f"{redeem} redeemed for {price} points.")
|
||||
else:
|
||||
send_chat(f"Cannot redeem {redeem}, no note included.")
|
||||
|
|
Loading…
Reference in New Issue