Код не переходит в функцию с декоратором @bot.message_handler() (pyTelegramBotAPI)
Всем привет! Создаю двух-язычного (ru, en) тг бота. Ниже часть кода с проблемой:
--------------------------------------------------------------------------------------
def colors(message):
global mood
if message.text == 'Весёлое ?' or message.text == 'Happy ?':
mood = 'happy'
text = f'Отлично! Настроение картинки - <b>{message.text}</b>. Теперь выберите основной цвет картинки из плиток в низу экрана.?'
if message.text == 'Весёлое ?':
markup1 = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
btn1r = types.KeyboardButton('Оранжевый ?')
btn2r = types.KeyboardButton('Красный ?')
btn3r = types.KeyboardButton('Жёлтый ?')
btn4r = types.KeyboardButton('Розовый ?')
btn5r = types.KeyboardButton('Зелёный ?')
markup1.row(btn1r, btn2r, btn3r)
markup1.row(btn4r, btn5r)
bot.send_message(message.from_user.id, text, parse_mode='html', reply_markup=markup1)
else:
text = translator.translate(text, src='ru', dest='en').text
markup1 = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
btn1e = types.KeyboardButton('Orange ?')
btn2e = types.KeyboardButton('Red ?')
btn3e = types.KeyboardButton('Yellow ?')
btn4e = types.KeyboardButton('Pink ?')
btn5e = types.KeyboardButton('Green ?')
markup1.row(btn1e, btn2e, btn3e)
markup1.row(btn4e, btn5e)
bot.send_message(message.from_user.id, text, parse_mode='html', reply_markup=markup1)
@bot.message_handler(content_types=['text'])
def pictures(message):
print('pictures')
if message.text == 'Оранжевый ?':
pass
elif message.text == 'Красный ?':
pass
elif message.text == 'Жёлтый ?':
pass
elif message.text == 'Розовый ?':
pass
elif message.text == 'Зелёный ?':
pass
--------------------------------------------------------------------------------------
Дело в том, что в моей задумке, при нажатии кнопки с любым цветом код должен выполнять функцию pictures. В ней даже есть print('pictures'), чтобы понять, работает ли она. Но она не работает! Подскажите, как это пофиксить?