After X wrong answers, sends an error message?

Hi, I am creating my frist Chatbot.

Its a refund chatbot and I need to get the “order number” from the clients.

I have the action.py doing the API calls to check for the numbers and retrieving some data if the order number does not exist I sent a error message that is not correct, try again etc.

I would like to check if the person tries X number of times to give it a different message with a phone number of custumer support of whatever.

Is there any way to do it?