J
J
Jok_god2021-07-03 00:54:43
Python
Jok_god, 2021-07-03 00:54:43

Python telebot how to make it determine the type of action?

I used to make a bot and it worked with a string

bot=telebot.teleBot('token')
@bot.message_handler(content_type=['text'])

but now he doesn’t want to take it in any way, and also use the function so that it works without stopping
bot.polling (none_stop=True, interval=0)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iMainDay, 2021-07-03
@iMainDay

You used the teleBot
method incorrectly And you also mistyped the content_type s
The correct usage in your case would be:

bot = telebot.TeleBot('token')
@bot.message_handler(content_types=['text'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question