Answer the question
In order to leave comments, you need to log in
Why is the telegram bot not responding to text messages?
the bot does not respond to text messages
on the /start command, the
code responds:
import telebot
bot = telebot.TeleBot('token')
@bot.message_handler(commands=['start'])
def start_message(message):
bot.send_message(message. chat.id, 'Hi, you texted me /start')
@bot.message_handler(content_types=['text'])
def send_text(message):
if message.text.lower() == 'hello':
bot.send_message (message.chat.id, 'Hello')
elif message.text.lower() == 'bye':
bot.send_message(message.chat.id, 'Bye')
bot.polling()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question