split long lines in redeems_handler.py

This commit is contained in:
Lili (Tlapka) 2023-01-09 15:17:45 +01:00
parent 25589ff69e
commit 537fa01aef
1 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,8 @@ def handle_redeem(message, user_id):
else: else:
send_chat(f"Redeeming {redeem} failed.") send_chat(f"Redeeming {redeem} failed.")
elif redeem_type == "list": elif redeem_type == "list":
if add_to_redeem_queue(db, user_id, redeem) and use_points(db, user_id, price): if (add_to_redeem_queue(db, user_id, redeem) and
use_points(db, user_id, price)):
send_chat(f"{redeem} redeemed for {price} points.") send_chat(f"{redeem} redeemed for {price} points.")
else: else:
send_chat(f"Redeeming {redeem} failed.") send_chat(f"Redeeming {redeem} failed.")
@ -39,7 +40,8 @@ def handle_redeem(message, user_id):
if not note: if not note:
send_chat(f"Cannot redeem {redeem}, no note included.") send_chat(f"Cannot redeem {redeem}, no note included.")
return return
if add_to_redeem_queue(db, user_id, redeem, remove_emoji(note)) and use_points(db, user_id, price): if (add_to_redeem_queue(db, user_id, redeem, remove_emoji(note)) and
use_points(db, user_id, price)):
send_chat(f"{redeem} redeemed for {price} points.") send_chat(f"{redeem} redeemed for {price} points.")
else: else:
send_chat(f"Redeeming {redeem} failed.") send_chat(f"Redeeming {redeem} failed.")