forked from MarseyWorld/MarseyWorld
fdfd
parent
e1ad306ee7
commit
7e3b63eeca
File diff suppressed because one or more lines are too long
|
@ -202,12 +202,26 @@ def transfer_coins(v, username):
|
|||
if v.coins < amount: return {"error": f"You don't have enough {app.config['COINS_NAME']}"}, 400
|
||||
if amount < 100: return {"error": f"You have to gift at least 100 {app.config['COINS_NAME']}."}, 400
|
||||
|
||||
tax = math.ceil(amount*0.015)
|
||||
tax = math.ceil(amount*0.03)
|
||||
tax_receiver = g.db.query(User).filter_by(id=TAX_RECEIVER_ID).first()
|
||||
tax_receiver.coins += tax
|
||||
tax_receiver.coins += tax/3
|
||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||
send_notification(TAX_RECEIVER_ID, log_message)
|
||||
g.db.add(tax_receiver)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
carp = g.db.query(User).filter_by(id=CARP_ID).first()
|
||||
carp.coins += tax/3
|
||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||
send_notification(CARP_ID, log_message)
|
||||
g.db.add(carp)
|
||||
|
||||
dad = g.db.query(User).filter_by(id=DAD_ID).first()
|
||||
dad.coins += tax/3
|
||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||
send_notification(DAD_ID, log_message)
|
||||
g.db.add(dad)
|
||||
|
||||
receiver.coins += amount-tax
|
||||
v.coins -= amount
|
||||
send_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {amount-tax} {app.config['COINS_NAME']}!")
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<script src="/assets/js/userpage.js?v=58"></script>
|
||||
<script src="/assets/js/userpage.js?v=59"></script>
|
||||
<title>{{u.username}}'s profile - {{'SITE_NAME' | app_config}}</title>
|
||||
{% if u.is_private %}
|
||||
<meta name="robots" content="noindex">
|
||||
|
|
Loading…
Reference in New Issue