buttons.py 728 B

123456789101112131415161718192021
  1. from aiogram.types import ReplyKeyboardRemove, \
  2. ReplyKeyboardMarkup, KeyboardButton, \
  3. InlineKeyboardMarkup, InlineKeyboardButton
  4. button_get_events = KeyboardButton('Мои мероприятия')
  5. events_kb = ReplyKeyboardMarkup(resize_keyboard=True)
  6. events_kb.add(button_get_events)
  7. def create_yes_no_btns(yes_data: str) -> InlineKeyboardMarkup:
  8. inline_btn_yes = InlineKeyboardButton(
  9. 'Да, отменяем!', callback_data=yes_data)
  10. inline_btn_no = InlineKeyboardButton(
  11. 'Нет, оставим, как есть', callback_data="cancel")
  12. inline_kb_yes_no = InlineKeyboardMarkup().add(inline_btn_yes)
  13. inline_kb_yes_no.add(inline_btn_no)
  14. return inline_kb_yes_no