Botpress: Implement a default fallback or error response.

Created on 2 Apr 2017  路  6Comments  路  Source: botpress/botpress

We should have a way of having a bot send a message when the server encounters an error for a better experience for users.

Additionally in Bottr I had a way of detecting when a incoming message wasn't handled and have the bot automatically respond to let the user it hadn't been taught what to do with that message.

This catch all was good for UX since the developer could spot code paths they missed out easily and it didn't strand the user.

How it worked is there was a middleware which always was executed last which would send "sorry I wasn't taught anything else". When implementing the equivalent of the Hears middleware in Bottr it would only call the next middleware for the incoming message chain when there wasn't a match.

Eventually if nothing had handled the incoming text then the catch-all middleware would be triggered.

Most helpful comment

@fstn Hey so this has been implemented but isn't documented: https://github.com/botpress/botpress/blob/b862db4a5f3eb39bdbd20afae46b12dc3138398a/src/fallback.js

Would appreciate a PR to the doc

All 6 comments

Great idea!! Maybe the default would be like you say + we could give the developers a way of switching to:

1 (default) - Respond to the user "I'm sorry, ... " + warn message in logger
2 - Don't say anything but pop a Botpress notifications + a warn message logger
3 - Warn in logger only
4 - Custom handler

What do you think?!

Yeah maximum flexibility :)

Cool! Like this idea. Let's implement this :)

+1

@fstn Hey so this has been implemented but isn't documented: https://github.com/botpress/botpress/blob/b862db4a5f3eb39bdbd20afae46b12dc3138398a/src/fallback.js

Would appreciate a PR to the doc

Hi,
Can you provide detail explanation for this.
Where we can add this script or if it can be handled at UI

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slvnperron picture slvnperron  路  7Comments

JustusNBB picture JustusNBB  路  9Comments

JijeshP picture JijeshP  路  7Comments

rainmakerho picture rainmakerho  路  4Comments

crixx picture crixx  路  6Comments