How to implement a welcome message

what about doing something with action_session_start or similar? I’m trying with this code but nothing happens

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

@ayoubelma I mean did you know Rasa/botfront Widget : 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.

@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

@ayoubelma Is 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?

@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

@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

Still trying but nothing for the moment

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

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

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

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

final solotion (for my case), in socketio.py session_request method

  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