Outro (end of chat) message and user feedback


(Daniel Stoddart) #1

Hello,

In the Default Conversation -> Event Handlers section there is a “On Connect” event and I’m looking for something similar for an outro message.

If I wanted to add an “end of chat” message how would you best advise implementing this?

I am also playing around with the idea of gathering user feedback at the end of a chat flow. I have add subscribed to the “onEvent” event (Fires everytime a Dialog or FAQ is finished) and then using the SDK I present the user with a quick reply template: “Please rate you chat experience” with 1 to 5 options.

When i click on a quick reply the bot gives the standard “I don’t understand what you mean but this is what I can do for you” as it’s is processing the number (1,2,3,4 or 5) as an utterance.

How would recommend building such a feature so that it doesn’t have to be added as a task to the end of every chat flow (assuming there are many chat flows so want to reduce repetition and create global behaviour).

Thanks in advance!
Dan


(Subrahmanyam Donepudi) #2

Hi @dan.stoddart,
Currently the platform doesn’t provide an “end of the conversation” event at event handlers. But this can be achieved by subscribing to event “onEvent” and handling the data object from the botkit.

For achieving your use case, please refer to the below mentioned steps:

  1. Create a dialog (Say: “User Satisfaction” as a hidden dialog ) which has an entity node to collect user opinion.

  2. Configure the message at entity node to display a “quick replies with options from 1 to 5”

  3. Transition the entity node to a script node and store the received input into a BotContext type context variable. (You could even include the user info along with the select option if needed)

  4. Now at the botkit, you could configuration the logic as follows which invokes the “User Satisfaction” dialog every-time the “onEvent” is received and event type is “endDialog”

    on_event: function(requestId, data, callback)
    {
    if (data.event.eventType === “endDialog”)
    {
    data.message = ‘User Satisfaction’;
    return sdk.sendBotMessage(data, callback);
    }
    else {
    return callback(null, data);
    }
    }

Please refer to the below topic for more details: