how to detect commands in telegram bot (in python)

时间:2018-11-13 07:49:51

标签: python python-3.x telegram-bot

I'm developing a telegram bot

I can detect and use texts from users (update.message.text), what I want is, detect every command that user sends to bot.

is there a way to solve this?

  • python 3.7
  • python-telegram-bot module
  • win 10

1 个答案:

答案 0 :(得分:0)

我找到了:

我只添加MessageHandler(Filters.command, kb_handler)

conv_handler = ConversationHandler(
    entry_points=[CommandHandler('start', start),
                  MessageHandler(Filters.command, kb_handler)],
    states={},
    fallbacks=[]
)