master
Aevann 2024-11-15 18:07:18 +02:00
parent 151ce1c25a
commit 8361e3a809
1 changed files with 5 additions and 5 deletions

View File

@ -179,11 +179,11 @@ def transfer_currency(v, username, currency_name, apply_tax):
tax = math.ceil(amount*TAX_PCT) tax = math.ceil(amount*TAX_PCT)
if v.shadowbanned: if v.shadowbanned:
return {"message": f"{amount - tax} {currency_name} have been transferred to @{receiver.username}"} return {"message": f"{commas(amount-tax)} {currency_name} have been transferred to @{receiver.username}"}
reason = request.values.get("reason", "").strip() reason = request.values.get("reason", "").strip()
log_message = f"@{v.username} has transferred {amount} {currency_name} to @{receiver.username}" log_message = f"@{v.username} has transferred {commas(amount)} {currency_name} to @{receiver.username}"
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} {currency_name}!" notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {commas(amount-tax)} {currency_name}!"
if reason: if reason:
if len(reason) > TRANSFER_MESSAGE_LENGTH_LIMIT: if len(reason) > TRANSFER_MESSAGE_LENGTH_LIMIT:
@ -199,7 +199,7 @@ def transfer_currency(v, username, currency_name, apply_tax):
pay_reason = f'Gift from <a href="/id/{v.id}">@{v.username}</a>' pay_reason = f'Gift from <a href="/id/{v.id}">@{v.username}</a>'
receiver.pay_account(currency_name, amount - tax, pay_reason) receiver.pay_account(currency_name, amount - tax, pay_reason)
else: else:
raise ValueError(f"Invalid currency '{currency_name}' got when transferring {amount} from {v.id} to {receiver.id}") raise ValueError(f"Invalid currency '{currency_name}' got when transferring {commas(amount)} from {v.id} to {receiver.id}")
if CURRENCY_TRANSFER_ID: if CURRENCY_TRANSFER_ID:
send_repeatable_notification(CURRENCY_TRANSFER_ID, log_message) send_repeatable_notification(CURRENCY_TRANSFER_ID, log_message)