SDF
This commit is contained in:
parent
2d133cacda
commit
d12ff06f4f
9 changed files with 15 additions and 15 deletions
|
@ -256,9 +256,9 @@ def transfer_coins(v, username):
|
|||
amount = request.values.get("amount", "").strip()
|
||||
amount = int(amount) if amount.isdigit() else None
|
||||
|
||||
if amount is None or amount <= 0: return {"error": f"Invalid amount of coins."}, 400
|
||||
if v.coins < amount: return {"error": f"You don't have enough coins."}, 400
|
||||
if amount < 100: return {"error": f"You have to gift at least 100 coins."}, 400
|
||||
if amount is None or amount <= 0: return {"error": "Invalid amount of coins."}, 400
|
||||
if v.coins < amount: return {"error": "You don't have enough coins."}, 400
|
||||
if amount < 100: return {"error": "You have to gift at least 100 coins."}, 400
|
||||
|
||||
if not v.patron and not receiver.patron and not v.alts_patron and not receiver.alts_patron: tax = math.ceil(amount*0.03)
|
||||
else: tax = 0
|
||||
|
@ -275,7 +275,7 @@ def transfer_coins(v, username):
|
|||
g.db.commit()
|
||||
return {"message": f"{amount-tax} coins transferred!"}, 200
|
||||
|
||||
return {"message": f"You can't transfer coins to yourself!"}, 400
|
||||
return {"message": "You can't transfer coins to yourself!"}, 400
|
||||
|
||||
|
||||
@app.post("/@<username>/transfer_bux")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue