I have recently created a simple bot for telegram using the pyTelegramBotAPI (telebot).
I added a message handler that is supposed to handle every message, including the ones that appear on a group when a new user joins, which are still Message objects a non-null new_chat_members property.
import telebot
bot = telebot.TeleBot(TOKEN)
[...]
@bot.message_handler(func=lambda m: True)
def foo(message):
bot.send_message(message.chat.id,"I got the message")
bot.polling()
Even so, the bot does not reply with the "I got the message" string when I add a new user, although it does catch other messages.
Why is this happening? Is this a problem about the message handler? Is there maybe a more general handler that is sure to catch every update?
Thank you