# How to repeat the last bot utterance

**URL:** <https://forum.rasa.com/t/how-to-repeat-the-last-bot-utterance/4743>\
**Category:** Rasa Open Source\
**Created:** [January 29, 2019, 12:16pm UTC](https://forum.rasa.com/t/how-to-repeat-the-last-bot-utterance/4743 "2019-01-29T12:16:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![asmaier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/asmaier/32/1085_2.png) [@asmaier](https://forum.rasa.com/u/asmaier)\
**Post date:** [May 24, 2019, 1:19pm UTC](https://forum.rasa.com/t/how-to-repeat-the-last-bot-utterance/4743/4 "2019-05-24T13:19:25Z")

</div>

@custodio I extended your solution to also repeat button messages. My solution now looks like

```
class ActionRepeat(Action):
def name(self):
    return "action_repeat"

def run(self, dispatcher, tracker, domain):
    if len(tracker.events) >= 3:
        dispatcher.utter_message(tracker.events[-3].get('text'))
        data = tracker.events[-3].get('data')
        if data:
            if "buttons" in data:
                dispatcher.utter_button_message(text=None, buttons=data["buttons"])
    return []
```

---

_[View the full topic](https://forum.rasa.com/t/how-to-repeat-the-last-bot-utterance/4743)._
