Files
isp-tycoon/handlers/map.py
2026-02-23 14:22:24 +07:00

27 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# handlers/map.py
from aiogram import types, Router
from database import get_player
router = Router() # ← ВАЖНО! Регистрируем роутер
@router.callback_query(lambda c: c.data == "map")
async def show_map(callback: types.CallbackQuery):
player = get_player(callback.from_user.id)
districts = [
("🏠 Гараж (ваша база)", "✅ Подключён"),
("🏢 Центральный район", "🟡 В процессе" if player.get("next_build_end_ts", 0) > 0 else "🔒 Недоступен"),
("🎮 Западный квартал", "🔒 Недоступен"),
]
text = "🗺 *Карта города*\n\n"
for dist, status in districts:
text += f"{status}{dist}\n"
text += "\n💡 *Подсказка:* Прокачайте канал, чтобы подключить офисы и геймеров."
await callback.message.edit_text(
text,
parse_mode="Markdown",
reply_markup=types.InlineKeyboardMarkup(inline_keyboard=[
[types.InlineKeyboardButton(text="⬅️ Назад", callback_data="back_menu")]
])
)