Исправил пару вещей
This commit is contained in:
@@ -3,7 +3,7 @@ from aiogram.filters import Command
|
||||
from aiogram.enums.parse_mode import ParseMode
|
||||
import logging
|
||||
|
||||
from .start import call_api # используем уже готовый HTTP-хелпер
|
||||
from .start import call_api
|
||||
|
||||
router = Router()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -71,20 +71,15 @@ def _plan_human_title(plan: str) -> str:
|
||||
|
||||
|
||||
async def _fetch_user_and_subs(telegram_id: int):
|
||||
"""
|
||||
Бляяяяядь.. убейте
|
||||
"""
|
||||
user = await call_api("GET", f"/user/{telegram_id}")
|
||||
|
||||
if not isinstance(user, dict) or user.get("id") is None:
|
||||
if not isinstance(user, dict):
|
||||
return None, []
|
||||
user_id = user.get("id") or user.get("telegram_id") or user.get("user_id")
|
||||
if not user_id:
|
||||
return None, []
|
||||
|
||||
user_id = user["id"]
|
||||
|
||||
subs = await call_api("GET", f"/subscriptions/{user_id}")
|
||||
if subs == "ERROR" or not isinstance(subs, list):
|
||||
subs = []
|
||||
|
||||
return user, subs
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ def main_keyboard():
|
||||
callback_data="profile",
|
||||
)
|
||||
)
|
||||
# ------
|
||||
builder.row(
|
||||
InlineKeyboardButton(
|
||||
text="❔ FAQ ❔",
|
||||
@@ -102,7 +101,7 @@ def popup_keyboard():
|
||||
builder.row(
|
||||
InlineKeyboardButton(
|
||||
text="🔙 Назад",
|
||||
callback_data="profile", # назад в профиль
|
||||
callback_data="profile",
|
||||
)
|
||||
)
|
||||
return builder.as_markup()
|
||||
@@ -180,7 +179,7 @@ def ticket_keyboard():
|
||||
builder.row(
|
||||
InlineKeyboardButton(
|
||||
text="🔙 Отмена",
|
||||
callback_data="cancel",
|
||||
callback_data="cancel_ticket", # БЫЛО "cancel"
|
||||
)
|
||||
)
|
||||
return builder.as_markup()
|
||||
|
||||
Reference in New Issue
Block a user