from aiogram import types, Dispatcher
from bot_creat import dp, bot
from keyboards import kb_client
#@dp.message_handler(commands=['start'])
async def start_command(message : types.Message):
try:
await bot.send_message(message.from_user.id, 'Hello', reply_markup=kb_client)
await message.delete()
except:
await message.reply('Общение с ботом через ЛС, напишите ему:\
nhttps://t.me/vazeit_bot')
#@dp.message_handler(commands=['Подготовка_к_ОГЭ'])
async def button(message : types.Message):
markup = types.InlineKeyboardMarkup(row_width=2)
info = types.InlineKeyboardButton('Информатика', callback_data='info')
fizika = types.InlineKeyboardButton('Физика', callback_data='fizika')
Russia = types.InlineKeyboardButton('Русский язык', callback_data='Russia')
matem = types.InlineKeyboardButton('Математика', callback_data='matem')
buol = types.InlineKeyboardButton('Биология', callback_data='buol')
geograf = types.InlineKeyboardButton('География', callback_data='geograf')
litra = types.InlineKeyboardButton('Литература', callback_data='litra')
humia = types.InlineKeyboardButton('Химия', callback_data='humia')
obhestvo = types.InlineKeyboardButton('Обществознание', callback_data='obhestvo')
English = types.InlineKeyboardButton('английский язык', callback_data='English')
ustoria = types.InlineKeyboardButton('История', callback_data='ustoria')
markup.add(info, fizika, Russia, matem, buol, geograf, litra, humia, obhestvo, English, ustoria)
await bot.send_message(message.chat.id, 'Выбирите предмет:', reply_markup=markup)
@dp.callback_query_handler(lambda callback: callback.data)
async def check_callback_data(callback):
if callback.data == 'info':
markup = types.InlineKeyboardMarkup(row_width=1)
info1 = types.InlineKeyboardButton(text='Вариарнт 1', callback_data='info')
info2 = types.InlineKeyboardButton(text='Вариарнт 2', callback_data='info2')
info3 = types.InlineKeyboardButton(text='Вариарнт 3', callback_data='info3')
info4 = types.InlineKeyboardButton(text='Вариарнт 4', callback_data='info4')
info5 = types.InlineKeyboardButton(text='Вариарнт 5', callback_data='info5')
info6 = types.InlineKeyboardButton(text='Вариарнт 6', callback_data='info6')
info7 = types.InlineKeyboardButton(text='Вариарнт 7', callback_data='info7')
info8 = types.InlineKeyboardButton(text='Вариарнт 8', callback_data='info8')
info9 = types.InlineKeyboardButton(text='Вариарнт 9', callback_data='info9')
info10 = types.InlineKeyboardButton(text='Вариарнт 10', callback_data='info10')
info11 = types.InlineKeyboardButton(text='Вариарнт 11', callback_data='info11')
markup.add(info1, info2, info3, info4, info5, info6, info7, info8, info9, info10, info11)
bot.edit__message_text(chat_id=callback.message.chat.id, message_id=callback.message.id, text='Выбирите Вариарнт', reply_markup=markup)
def register_handlers_client(dp : Dispatcher):
dp.register_message_handler(start_command, commands=['start'])
dp.register_message_handler(button, commands=['Подготовка_к_ОГЭ'])