# How to let bot speak first

**URL:** <https://forum.rasa.com/t/how-to-let-bot-speak-first/1463>\
**Category:** Rasa Open Source\
**Created:** [September 28, 2018, 3:26am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463 "2018-09-28T03:26:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuxuan2018](https://avatars.discourse-cdn.com/v4/letter/y/48db29/32.png) [@yuxuan2018](https://forum.rasa.com/u/yuxuan2018)\
**Post date:** [September 28, 2018, 3:26am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463/1 "2018-09-28T03:26:37Z")

</div>

How to let the bot speak first, instead of waiting for the user to say it before replying as follow start conversation: bot: Can i help you? user:

---

<div class="post-metadata">

**Author:** ![fade2black](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fade2black/32/1922_2.png) [@fade2black](https://forum.rasa.com/u/fade2black)\
**Post date:** [September 28, 2018, 3:40am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463/2 "2018-09-28T03:40:46Z")

</div>

One possible approach is as following. I assume you speak to your bot from a command line (not through a web interface).

```auto
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.utils import EndpointConfig
from rasa_core.run import serve_application
import rasa_core

def talk():
    agent = Agent.load('./models/dialogue',
        interpreter=RasaNLUInterpreter('./models/nlu/default/so_health/'),
        action_endpoint=EndpointConfig(url="http://172.17.0.3:8080/"))

    print("Hi dude! I'm a bot. How can I help you? ")
    while True:
        a = input()
        if a == 'stop':
            break
        responses = agent.handle_message(a)
  
        for response in responses:
            print(response["text"])

talk()

```

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [October 2, 2018, 8:52am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463/3 "2018-10-02T08:52:08Z")

</div>

You have to have the backend send a first message to the bot (e.g. `/greet`) when the user clicks to start the conversation with the bot. Facebook does this automatically for example, by having the “get startd” button

---

<div class="post-metadata">

**Author:** ![chemseddine](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@chemseddine](https://forum.rasa.com/u/chemseddine)\
**Post date:** [December 11, 2018, 9:35am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463/4 "2018-12-11T09:35:51Z")

</div>

Hi akelad,

Do you have an idea how slalck can do this (send me message when user clic on the bot bouton on slack)

Thank you

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [December 20, 2018, 11:31am UTC](https://forum.rasa.com/t/how-to-let-bot-speak-first/1463/5 "2018-12-20T11:31:25Z")

</div>

Sorry not sure, you would have to check their documentation
