diff --git a/files/helpers/const.py b/files/helpers/const.py index f9ec694365..55701bd252 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -98,7 +98,6 @@ if SITE == 'rdrama.net': ZOZBOT_ACCOUNT = 1833 AUTOPOLLER_ACCOUNT = 6176 TAX_RECEIVER_ID = 747 - TAX_RATE = 0.01 PIZZA_SHILL_ID = 2424 CARP_ID = 995 LAWLZ_ID = 3833 @@ -111,8 +110,7 @@ elif SITE == "pcmemes.net": LONGPOSTBOT_ACCOUNT = 1832 ZOZBOT_ACCOUNT = 1833 AUTOPOLLER_ACCOUNT = 3369 - TAX_RECEIVER_ID = 1 - TAX_RATE = 0 + TAX_RECEIVER_ID = 1577 PIZZA_SHILL_ID = 0 CARP_ID = 0 LAWLZ_ID = 0 @@ -125,7 +123,6 @@ else: ZOZBOT_ACCOUNT = 5 AUTOPOLLER_ACCOUNT = 6 TAX_RECEIVER_ID = 7 - TAX_RATE = 0 PIZZA_SHILL_ID = 0 CARP_ID = 0 LAWLZ_ID = 0 diff --git a/files/routes/users.py b/files/routes/users.py index 7b02024b98..f9a5e590b7 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -128,26 +128,20 @@ 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 - if TAX_RATE and TAX_RECEIVER_ID: - tax = math.ceil(amount*TAX_RATE) - tax_receiver = g.db.query(User).filter_by(id=TAX_RECEIVER_ID).first() - tax_receiver.coins += tax - 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) - taxed = amount-tax - receiver.coins += taxed - else: taxed = amount - + tax = math.ceil(amount*0.01) + tax_receiver = g.db.query(User).filter_by(id=TAX_RECEIVER_ID).first() + tax_receiver.coins += tax + 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) + receiver.coins += amount-tax v.coins -= amount - - send_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {taxed} {app.config['COINS_NAME']}!") - + send_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {amount-tax} {app.config['COINS_NAME']}!") g.db.add(receiver) g.db.add(v) g.db.commit() - return {"message": f"{taxed} {app.config['COINS_NAME']} transferred!"}, 200 + return {"message": f"{amount-tax} {app.config['COINS_NAME']} transferred!"}, 200 return {"message": f"You can't transfer {app.config['COINS_NAME']} to yourself!"}, 400 diff --git a/files/templates/header.html b/files/templates/header.html index 75c450983a..a2194635d9 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -109,7 +109,7 @@
{{v.username}}
-
{{v.coins}} {{'COINS_NAME' | app_config}}
+
{{v.coins}} {{'COINS_NAME' | app_config}}
{% if v.procoins %}
{{v.procoins}} Marseybux
{% endif %}