from aiogram import Router, types, F from aiogram.filters import CommandStart, Command from aiogram.types import KeyboardButton, ReplyKeyboardMarkup from aiogram.utils import markdown from config import WHITELIST_CHAT_IDS router = Router(name=__name__) async def is_whitelist(chat_id: int) -> bool: return chat_id in WHITELIST_CHAT_IDS @router.message(CommandStart()) async def handle_start(message: types.Message): if await is_whitelist(message.chat.id): button_settings = KeyboardButton(text="Настройки") button_help = KeyboardButton(text="Помощь") button_active_triggers = KeyboardButton(text="Активные тригеры") button_row = [button_settings,button_help,button_active_triggers] markup = ReplyKeyboardMarkup(keyboard=[button_row],resize_keyboard=True) else: button_register = KeyboardButton(text="Регистрация") button_row = [button_register] markup = ReplyKeyboardMarkup(keyboard=[button_row],resize_keyboard=True, one_time_keyboard=True) await message.answer(text="Выберите действие:", reply_markup=markup) @router.message(Command("help")) async def handle_help(message: types.Message): text = markdown.text("/start - Показать меню бота\n", markdown.hbold("Настройки"),"- Перейти в режим настроек и управления подписками\n", markdown.hbold("Активные тригеры")," - Получение активных проблем за последние 24 часа\n", markdown.text( markdown.hbold("Помощь - "), markdown.hlink("Описание всех возможностей бота", "https://confluence.is-mis.ru/pages/viewpage.action?pageId=460596141"), sep=""), sep="") await message.answer(text=text)