There are 2 ways to detect emotion, either from the user's speech/tone or from the text of the user's input (only based on the words, not tone).
For speech, Bot Libre Analytics support creating your own audio classification deep learning network.
You would need to train the network on a wide variety of speech audio with different emotions and voices.
We can help you develop this through our developments services (contact [email protected]).
For text, Bot Libre NLP has built-in support for classifying emotions and sentiment. You can train your bot to classify certain words, fragments, or phrases with different emotions from the bot's Training & Chat Logs page. Select Words or Phrases from the search drop down, or import the Emotions and Sentiment script,
You could also use a 3rd party web API from your app or bot's scripts to access 3rd party support from another provider for this.