A
A
Andriy4262021-09-05 11:40:55
Python
Andriy426, 2021-09-05 11:40:55

How to make the bot reply to any message?

That is, when if message.text == is empty. The code does not work what needs to be put in brackets so that any message is read.

@bot.message_handler(commands=['test'])
def test(message):
    bot.send_message(message.chat.id, 'Напишите что-то')
    if message.text == '':
        bot.send_message(message.chat.id, 'Спасибо')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question