Добавлена ветка cosmetics
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
"""Services handler - show rich service cards with images."""
|
||||
from aiogram import Router, F
|
||||
from aiogram.types import Message, FSInputFile, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
|
||||
from aiogram.types import Message, FSInputFile
|
||||
from aiogram.fsm.context import FSMContext
|
||||
from aiogram import Bot
|
||||
|
||||
from app.config import SERVICES, BOT_TOKEN
|
||||
from app.keyboards.services import get_services_keyboard
|
||||
from app.logger import logger
|
||||
|
||||
router = Router()
|
||||
@@ -24,18 +25,21 @@ async def show_services(message: Message, state: FSMContext):
|
||||
await state.clear()
|
||||
logger.info("User {uid} requested services list", uid=message.from_user.id)
|
||||
|
||||
await message.answer(
|
||||
"\U0001f4cb **\u041d\u0430\u0448\u0438 \u0443\u0441\u043b\u0443\u0433\u0438**\n\n"
|
||||
"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0443\u044e \u0443\u0441\u043b\u0443\u0433\u0443:",
|
||||
reply_markup=get_services_keyboard()
|
||||
)
|
||||
|
||||
for key, svc in SERVICES.items():
|
||||
try:
|
||||
card = (
|
||||
svc["emoji"] + " " + svc["name"] + "\n\n"
|
||||
svc["emoji"] + " **" + svc["name"] + "**\n\n"
|
||||
+ svc["desc"] + "\n\n"
|
||||
+ "\u23f1 \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: " + str(svc["duration"]) + " \u043c\u0438\u043d\n"
|
||||
+ "\U0001f4b0 \u0426\u0435\u043d\u0430: " + str(svc["price"]) + "\u20bd"
|
||||
)
|
||||
book_btn = InlineKeyboardMarkup(inline_keyboard=[[
|
||||
InlineKeyboardButton(text="\U0001f4c5 \u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f", callback_data=key)
|
||||
]])
|
||||
img = FSInputFile(svc["image"])
|
||||
await bot().send_photo(message.chat.id, photo=img, caption=card, reply_markup=book_btn)
|
||||
await bot().send_photo(message.chat.id, photo=img, caption=card)
|
||||
except Exception as e:
|
||||
logger.warning("Error sending service card for {key}: {err}", key=key, err=e)
|
||||
|
||||
Reference in New Issue
Block a user