Telegram bot written in python. How to do if sent exactly the message that you asked the bot to respond?

Here is the code -
import telebot
import config
from telebot import types

bot = telebot.TeleBot(config.token)

def start(m):
 msg = bot.send_message(, 'Hello!')
 keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
 keyboard.add(*[types.Keyboardbutton to(name) for name in ['Sherlock Holmes', 'Dr Watson']])
 bot.send_message(, 'Whom to choose?',
 bot.register_next_step_handler(msg, name)
def name(m):
 if m.text == 'Sherlock Holmes':
 bot.send_message(, '*You chose Sherlock Holmes', parse_mode='Markdown')
 elif m.text == 'Dr. Watson':
 bot.send_message(, '*You chose Dr. Watson', parse_mode='Markdown')</b>


But when I click on button it displays the text but no answer from bot no!

What is the error?

If you want to -

Thanks in advance!
June 14th 19 at 19:19
2 answers
June 14th 19 at 19:21
def messages(message):
 if 'Sherlock' in the message.text.lower() or 'Holmes' in the message.text.lower():
 bot.send_message(, 'You chose Sherlock')
 elif 'doctor' in message.text.lower() or 'Watson' in the message.text.lower():
 bot.send_message(, 'You have chosen Watson')
Thank you so much! Very helpful. 3 hours tormented. Thank you. - nikita.Stracke commented on June 14th 19 at 19:24
June 14th 19 at 19:23
It's much easier. You have code error:
def name(m):</b>

Instead of here: "<b>"</b>must be a handle: @bot.message_handler(content_types=['text'])

Find more questions by tags BotsMessengersPython