Meysam Rahimi
Meysam Rahimi

Reputation: 154

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?

Upvotes: 3

Views: 204

Answers (1)

masoodbayati
masoodbayati

Reputation: 345

you can use this sample code

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

Upvotes: 4

Related Questions