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