refactor: enhance transaction logging for premium, stars, and TON topup methods

This commit is contained in:
bohd4nx
2026-03-08 04:37:07 +02:00
parent 38a4619e42
commit c3de8a8ca3
6 changed files with 11 additions and 16 deletions
+3 -11
View File
@@ -14,9 +14,7 @@ async def topup_ton_example():
result = await topup_ton("@bohd4nx", 100)
if result["success"]:
data = result["data"]
logger.info(f"TON topup successful: {data['amount']} TON sent to {data['username']}")
logger.info(f"Transaction ID: {data['transaction_id']}")
pass # Transaction successful, details are logged in the method
else:
logger.error(f"TON topup failed: {result['error']}")
@@ -28,11 +26,7 @@ async def buy_premium_example():
result = await buy_premium("@bohd4nx", 12)
if result["success"]:
data = result["data"]
logger.info(
f"Premium purchase successful: {data['months']} months sent to {data['username']}"
)
logger.info(f"Transaction ID: {data['transaction_id']}")
pass # Transaction successful, details are logged in the method
else:
logger.error(f"Premium purchase failed: {result['error']}")
@@ -44,9 +38,7 @@ async def buy_stars_example():
result = await buy_stars("@bohd4nx", 1000000)
if result["success"]:
data = result["data"]
logger.info(f"Stars purchase successful: {data['amount']} stars sent to {data['username']}")
logger.info(f"Transaction ID: {data['transaction_id']}")
pass # Transaction successful, details are logged in the method
else:
logger.error(f"Stars purchase failed: {result['error']}")