после запуска бот выводит "выберите слово с правильным ударением ", я выбираю вариант, а дальше он ничего не отвечает
import telebot
from telebot import types
bot = telebot.TeleBot('.....')
points = 0
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Введите /train, чтобы начать тренироваться \nВведите /start для перезапуска')
@bot.message_handler(commands=['train'])
def train(message):
points = 0
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
word1 = types.KeyboardButton('аэропОрты')
word2 = types.KeyboardButton('аэропортЫ')
markup.add(word1, word2)
bot.send_message(message.chat.id, 'Выберите слово с правильным ударением:', reply_markup=markup)
if message.chat.type == 'private':
# начинаем отслеживать 1 вопрос
if message.text == word1:
bot.send_message(message.chat.id, 'Верно')
points +=1
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
word1 = types.KeyboardButton('бАнты')
word2 = types.KeyboardButton('бантЫ')
markup.add(word1, word2)
bot.send_message(message.chat.id, 'Выберите слово с правильным ударением:', reply_markup=markup)
elif message.text == word2:
bot.send_message(message.chat.id, f"Неверно. Ваш счёт: {points}")
bot.polling(none_stop=True)
Источник: Stack Overflow на русском