автопродление ключа

This commit is contained in:
Vladless
2024-10-13 23:11:39 +03:00
parent a0bada3e76
commit 41dd64f7c8
2 changed files with 45 additions and 15 deletions
+6
View File
@@ -160,6 +160,12 @@ async def handle_referral_on_balance_update(tg_id: int, amount: float):
# Начисляем бонус (25% от платежа) пригласившему
bonus = amount * 0.25 # 25% от платежа
# Проверяем, чтобы бонус не был отрицательным
if bonus < 0:
bonus = 0
# Обновляем баланс пригласившего
await update_balance(referrer_tg_id, bonus)
# Обновляем статус бонуса для пригласившего