master
Aevann1 2021-11-18 16:43:50 +02:00
parent e1ad306ee7
commit 7e3b63eeca
3 changed files with 18 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -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']}!")

View File

@ -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">