show gift reason in public transfer log

remotes/1693045480750635534/spooky-22
Aevann1 2022-06-15 15:36:33 +02:00
parent cdcef7d01d
commit 7ec994d4b3
1 changed files with 5 additions and 3 deletions

View File

@ -419,12 +419,14 @@ def transfer_coins(v, username):
receiver.coins += amount - tax
log_message = f"@{v.username} has transferred {amount} coins to @{receiver.username}"
send_repeatable_notification(GIFT_NOTIF_ID, log_message)
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} coins!"
if reason:
if len(reason) > 200: return {"error": "Reason is too long, max 200 characters"},400
notif_text += f"\n\n> {reason}"
log_message += f"\n\n> {reason}"
send_repeatable_notification(GIFT_NOTIF_ID, log_message)
send_repeatable_notification(receiver.id, notif_text)
g.db.add(receiver)
@ -1274,4 +1276,4 @@ def fp(v, fp):
print(v.username + ' + ' + u.username, flush=True)
g.db.add(v)
g.db.commit()
return '', 204
return '', 204