fdf
This commit is contained in:
parent
e8eec1792a
commit
d7c7db6619
3 changed files with 60 additions and 44 deletions
|
@ -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']}!")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue