Search code examples
pythonpython-3.xmessengerbale-messenger

How to set two message handlers in one function


I want to set both TemplateResponseFilter and TextFilter in one message handler in a function. i used one handler before like this:

@dispatcher.message_handler(TextFilter(pattern=["start"]))

but i couldn't set both of them. any one can help?


Solution

  • you can use this sample code

    @dispatcher.message_handler(
    filters=[TemplateResponseFilter(pattern=TMessage.start), TextFilter(keywords="start")])