# How to implement a welcome message

**URL:** <https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282>\
**Category:** Rasa Open Source\
**Created:** [November 17, 2021, 9:30am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282 "2021-11-17T09:30:21Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [November 18, 2021, 9:33am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/22 "2021-11-18T09:33:16Z")

</div>

what about doing something with action\_session\_start or similar? I’m trying with this code but nothing happens

```auto
class ActionSessionStart(Action):
    def name(self) -> Text:
        return "action_session_start"

    async def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[EventType]:

        # the session should begin with a `session_started` event
        events = [SessionStarted()]

        # any slots that should be carried over should come after the
        # `session_started` event
        print("Ciao test")
        dispatcher.utter_message(text=f"ciao test")

        # an `action_listen` should be added at the end as a user message follows
        events.append(ActionExecuted("action_listen"))

        return events

```

I’ve also added action\_session\_start in domain file

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 18, 2021, 10:33am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/23 "2021-11-18T10:33:05Z")

</div>

@ayoubelma I mean did you know Rasa/botfront Widget : [https://github.com/botfront/rasa-webchat](https://github.com/botfront/rasa-webchat) Which is easy to implement and customise. Yes or No?

This widget also have the feature of Automatic Welcome message by Chatbot whilst user click on chatbot widget.

If you want to know more, do let me know.

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [November 18, 2021, 10:42am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/24 "2021-11-18T10:42:26Z")

</div>

@nik202 I know there are others widget like botfront, I’m trying to mantain the one indicated in the rasa site. In case, if I decide to try botfront, is there the possibility to set the data-token in it? I did now a quick test and it doesn’t seems to work

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 18, 2021, 10:53am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/31 "2021-11-18T10:53:24Z")

</div>

@ayoubelmaIs your website is hosted somewhere? Yes or No?  
are your rasa chatbot is running on server? Yes or no? Is your website have static or dynamic webpages?

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [November 18, 2021, 10:55am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/33 "2021-11-18T10:55:22Z")

</div>

@nik202 yes it is in a server, yes also rasa is running in a server, my site have dynamic pages. Is for work so i need jwt for more security

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [November 18, 2021, 11:04am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/34 "2021-11-18T11:04:26Z")

</div>

@nik202 do you know if is possible to catch user connected event in someway? I’m thinking about something like a some action in py that catch it and utter a message

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [December 2, 2021, 11:43am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/35 "2021-12-02T11:43:07Z")

</div>

Still trying but nothing for the moment

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 2, 2021, 12:07pm UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/36 "2021-12-02T12:07:11Z")

</div>

@ayoubelma as it much depend on frontend as we request the HTTP from rasa to website and get the response.

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [December 3, 2021, 9:38am UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/37 "2021-12-03T09:38:25Z")

</div>

In my case I finally solved editing socketio.py, I added 2 event emit on method session\_reques

```auto
await sio.emit("user_uttered", {"message":"ciao", "session_id":data["session_id"]})
 await sio.emit("bot_uttered", {"text":""" Ciao from bot """})

```

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [December 3, 2021, 4:21pm UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/38 "2021-12-03T16:21:21Z")

</div>

i faced that this method sends to all chats and not to the single user

---

<div class="post-metadata">

**Author:** ![ayoubelma](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@ayoubelma](https://forum.rasa.com/u/ayoubelma)\
**Post date:** [December 6, 2021, 3:18pm UTC](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282/39 "2021-12-06T15:18:06Z")

</div>

final solotion (for my case), in socketio.py session\_request method

```auto
  await sio.emit("user_uttered", {"message":"ciao", "session_id":data["session_id"]})
   await sio.emit("bot_uttered", {"text":""" ciao by bot """}, room=sid)

```

added “room” in bot\_uttered emit. Hope it helps someone

[Previous page](https://forum.rasa.com/t/how-to-implement-a-welcome-message/49282.md?page=1)
