I want my bot to send a message when it detect documents is sent in a chat.
I add a message handler with document filter.
The code works for chat to the bot directly,
but if I add the bot into a group,
the bot has no response if I sent a document in the group.
The code is:
def test(bot, update):
bot.sendMessage(update.message.chat_id, text='OK!')
print "OK"
def main():
token = 'xxxxxxyyyyy'
updater = Updater(token, workers=10)
dp = updater.dispatcher
dp.add_handler(CommandHandler("start", start))
dp.add_handler(CommandHandler("help", help))
dp.add_handler(MessageHandler([Filters.document], test))
updater.start_polling(timeout=10)
updater.idle()
Why the bot has no response when I send a file in a group? Thanks!