How to repeat the way say the last bot

You could make an action like this:

class ActionRepeat(Action):
def name(self) -> Text:
    return "action_repeat"

def run(self, dispatcher, tracker, domain):
    if len(tracker.events) >= 3:
        dispatcher.utter_message(tracker.events[-3].get('text'))
    return [UserUtteranceReverted()]

Regards,

1 Like