Answer the question
In order to leave comments, you need to log in
How to make the bot give a response if it sees a certain word in a message?
An example of an ordinary bot reaction to a specific message
if message_text == 'Привет':
bot.send_message(message.chat.id, 'И тебе привет')
Answer the question
In order to leave comments, you need to log in
use in
if "hello" in message.text.lower():
bot.send_message(message.chat.id, "Hello to you too")
Note that message.text.lower() takes a word and converts it to lowercase, those. HELLO will be treated as hello. So use words only in small letters, no capital letters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question