# repeated answer

**URL:** <https://forum.rasa.com/t/repeated-answer/59446>\
**Category:** Rasa Open Source\
**Created:** [August 24, 2023, 10:52am UTC](https://forum.rasa.com/t/repeated-answer/59446 "2023-08-24T10:52:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Alessandro](https://forum.rasa.com/u/Alessandro)\
**Post date:** [August 24, 2023, 10:52am UTC](https://forum.rasa.com/t/repeated-answer/59446/1 "2023-08-24T10:52:16Z")

</div>

Hello everyone,

I’m new to the Rasa community and I’ve been practicing the development of a chatbot. I’ve come across an issue regarding the handling of repeated requests. I would like the bot to automatically check the user’s input intents, and if 3 requests refer to the same intent, along with the response, a predefined message like “For further information, contact me at email…” would be added. Is it possible to implement a similar functionality?

Best regards,

Alessandro

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [August 24, 2023, 11:00am UTC](https://forum.rasa.com/t/repeated-answer/59446/2 "2023-08-24T11:00:01Z")

</div>

Hi @Alessandro, this is how you can implement it - [Configuring Policies](https://rasa.com/docs/rasa/policies/#configuring-policies) (similar to the **out\_of\_scope** example)

---

<div class="post-metadata">

**Author:** ![Alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Alessandro](https://forum.rasa.com/u/Alessandro)\
**Post date:** [August 25, 2023, 9:53am UTC](https://forum.rasa.com/t/repeated-answer/59446/3 "2023-08-25T09:53:34Z")

</div>

Thank you for the response, I’m conducting tests using the guide you sent me, and everything seems to be working. While researching online, I also found the option to manage everything through actions. Which one do you recommend using?

this is the action:

class CheckLastIntentsAction(Action): def name(self) → Text: return “action\_check\_last\_intents”

```
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

    all_user_intents = [event['parse_data']['intent']['name'] for event in tracker.events if event['event'] == 'user']
    last_three_intents = all_user_intents[-3:]
    if len(last_three_intents) == 3 and len(set(last_three_intents)) == 1:
        print("repeated.")
        response = """
        """
        dispatcher.utter_message(response)
        
    else:
        print(" OK.")
    
    return []

```
