from telebot import types
Token = ''
bot = telebot.TeleBot(Token)
@bot.message_handler(commands=['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
bt1 = types.KeyboardButton("Уравнения")
bt2 = types.KeyboardButton("Метадичка")
markup.add(bt1, bt2)
bot.send_message(message.chat.id, text="Привет".format(message.from_user), reply_markup=markup)
@bot.message_handler(content_types=['text'])
def ez(message):
if message.text == "Уравнения":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Легко")
btn2 = types.KeyboardButton("Нормально")
btn3 = types.KeyboardButton("Сложно")
back = types.KeyboardButton("Вернуться в главное меню")
markup.add(btn1, btn2, btn3, back)
bot.send_message(message.chat.id, text="Выберите уровень сложности", reply_markup=markup)
elif message.text == "Метадичка":
bot.send_message(message.chat.id, text="Pon")
elif message.text == "Легко":
bot.send_message(message.chat.id, text="111x^2-111x-111=0")
elif message.text == "1":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Следующее уравнение")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец, давай попробуем решить еще одно уравнение",reply_markup=markup)
elif message.text == "Следующее уравнение":
bot.send_message(message.chat.id, text="222x^2-222x-222=0")
elif message.text == "2":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Назад")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец,приступай к следующему уровню", reply_markup=markup)
elif message.text == "Назад":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Легко")
btn2 = types.KeyboardButton("Нормально")
btn3 = types.KeyboardButton("Сложно")
back = types.KeyboardButton("Вернуться в главное меню")
markup.add(btn1, btn2, btn3, back)
bot.send_message(message.chat.id, text="Выберите уровень сложности", reply_markup=markup)
elif message.text == "Вернуться в главное меню":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton("Уравнения")
button2 = types.KeyboardButton("Метадичка")
markup.add(button1, button2)
bot.send_message(message.chat.id, text="Вы вернулись в главное меню", reply_markup=markup)
@bot.message_handler(content_types=['text'])
def norm(message):
if message.text == "Нормально":
bot.send_message(message.chat.id, text="333x^2-333x+333=0")
elif message.text == "3":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Следующее уравнение")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец, давай попробуем решить еще одно уравнение",reply_markup=markup)
elif message.text == "Следующее уравнение":
bot.send_message(message.chat.id, text="553x^2-333x+333=0")
elif message.text == "4":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Следующее уравнение")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец, давай попробуем решить еще одно уравнение",reply_markup=markup)
elif message.text == "Вернуться в главное меню":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton("Уравнения")
button2 = types.KeyboardButton("Метадичка")
markup.add(button1, button2)
bot.send_message(message.chat.id, text="Вы вернулись в главное меню", reply_markup=markup)
@bot.message_handler(content_types=['text'])
def hard(message):
if message.text == "Сложно":
bot.send_message(message.chat.id, text="555x^2-555x-555=0")
elif message.text == "5":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Следующее уравнение(Сложно)")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец, давай попробуем решить еще одно уравнение",reply_markup=markup)
elif message.text == "Следующее уравнение(Сложно)":
bot.send_message(message.chat.id, text="666x^2-666x-666=0")
elif message.text == "6":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Назад")
markup.add(btn1)
bot.send_message(message.chat.id, text="Молодец,ты прошел все этапы", reply_markup=markup)
elif message.text == "Назад":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("Легко")
btn2 = types.KeyboardButton("Нормально")
btn3 = types.KeyboardButton("Сложно")
back = types.KeyboardButton("Вернуться в главное меню")
markup.add(btn1, btn2, btn3, back)
bot.send_message(message.chat.id, text="Выберите уровень сложности", reply_markup=markup)
elif message.text == "Вернуться в главное меню":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton("Уравнения")
button2 = types.KeyboardButton("Метадичка")
markup.add(button1, button2)
bot.send_message(message.chat.id, text="Вы вернулись в главное меню", reply_markup=markup)
bot.polling(none_stop=True)```