This commit is contained in:
Aevann1 2022-01-17 14:06:26 +02:00
parent e8eec1792a
commit d7c7db6619
3 changed files with 60 additions and 44 deletions

View file

@ -244,11 +244,13 @@ def transfer_coins(v, username):
tax = math.ceil(amount*0.03)
tax_receiver = g.db.query(User).filter_by(id=TAX_RECEIVER_ID).one_or_none()
tax_receiver.coins += tax
log_message = f"[@{v.username}](/id/{v.id}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.id})"
send_repeatable_notification(TAX_RECEIVER_ID, log_message)
g.db.add(tax_receiver)
else: tax = 0
if TAX_RECEIVED_ID:
log_message = f"[@{v.username}](/id/{v.id}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.id})"
send_repeatable_notification(TAX_RECEIVER_ID, log_message)
receiver.coins += amount-tax
v.coins -= amount
send_repeatable_notification(receiver.id, f"🤑 [@{v.username}](/id/{v.id}) has gifted you {amount-tax} {app.config['COINS_NAME']}!")