# How to get bot uttered message

**URL:** <https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757>\
**Category:** Rasa Open Source\
**Created:** [August 11, 2021, 9:53am UTC](https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757 "2021-08-11T09:53:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [August 11, 2021, 9:53am UTC](https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757/1 "2021-08-11T09:53:53Z")

</div>

Hi,

Is there any way to get bot’s last uttered message. like when i do this dispatcher.utter\_message(json\_message=json\_message). I need to get that last message

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [August 11, 2021, 11:49am UTC](https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757/2 "2021-08-11T11:49:07Z")

</div>

Not sure if that’s the best way, but on each `utter_message(msg)` you can set `msg` inside a slot.

```python
msg = "This is an example"
dispatcher.utter_message(msg)
return [SlotSet("last_message", msg)]

```

And then if you need to get the last message:

```python
last_message = tracker.get_slot("last_message")

```

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [August 11, 2021, 11:52am UTC](https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757/3 "2021-08-11T11:52:41Z")

</div>

Thank @ChrisRahme for your response.

Yes, this is one way. But i was looking for something that does not require the use of slots.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [August 11, 2021, 12:00pm UTC](https://forum.rasa.com/t/how-to-get-bot-uttered-message/46757/4 "2021-08-11T12:00:39Z")

</div>

Look at [Tracker.events\_after\_latest\_restart](https://rasa.com/docs/action-server/sdk-tracker#trackerevents_after_latest_restart), is it good enough?
