You should be able to get it by looking at the tracker, loop through the events looking for event==bot, check that the metadata.utter_action is the utterance that you want, then finally getting the text of that event.
You’ll understand a lot more if you print out the tracker and see it’s contents.
Something like:
for event in list(reversed(tracker.events)):
if event.get('event') == 'bot':
text_you_want = event.get('text')
However, this is not really what I want to do. I want to retrieve the message, without dispatching it.
I think that dispatcher.utter_message(template = x) is doing something under the hood to be able to select a message from this template x. I want to mimic this behavior so I could retrieve the message without dispatching.