Refactor inline referral handler and admin stats time display

- Simplified inline referral handler by removing unnecessary try-except block
- Increased cache time for inline query results
- Added Moscow timezone for admin stats update time display
This commit is contained in:
izzzzzi
2025-02-22 14:27:56 +05:00
parent a963f4ad12
commit 33801f58c4
2 changed files with 19 additions and 30 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ from typing import Any
from aiogram import F, Router
from aiogram.exceptions import TelegramBadRequest
from aiogram.types import CallbackQuery
import pytz
from filters.admin import IsAdminFilter
from keyboards.admin.panel_kb import AdminPanelCallback, build_admin_back_kb
@@ -54,8 +55,8 @@ async def handle_stats(callback_query: CallbackQuery, session: Any):
int(datetime.utcnow().timestamp() * 1000),
)
expired_keys = total_keys - active_keys
update_time = datetime.now().strftime("%d.%m.%y %H:%M:%S")
moscow_tz = pytz.timezone("Europe/Moscow")
update_time = datetime.now(moscow_tz).strftime("%d.%m.%y %H:%M:%S")
stats_message = (
f"📊 <b>Подробная статистика проекта:</b>\n\n"