show gift reason in public transfer log
parent
cdcef7d01d
commit
7ec994d4b3
|
@ -419,12 +419,14 @@ def transfer_coins(v, username):
|
||||||
receiver.coins += amount - tax
|
receiver.coins += amount - tax
|
||||||
|
|
||||||
log_message = f"@{v.username} has transferred {amount} coins to @{receiver.username}"
|
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!"
|
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} coins!"
|
||||||
|
|
||||||
if reason:
|
if reason:
|
||||||
if len(reason) > 200: return {"error": "Reason is too long, max 200 characters"},400
|
if len(reason) > 200: return {"error": "Reason is too long, max 200 characters"},400
|
||||||
notif_text += f"\n\n> {reason}"
|
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)
|
send_repeatable_notification(receiver.id, notif_text)
|
||||||
|
|
||||||
g.db.add(receiver)
|
g.db.add(receiver)
|
||||||
|
@ -1274,4 +1276,4 @@ def fp(v, fp):
|
||||||
print(v.username + ' + ' + u.username, flush=True)
|
print(v.username + ' + ' + u.username, flush=True)
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
Loading…
Reference in New Issue