// This script checks the sentiment of the user's input and return an appropriate response. // You need to import common word sentiment, or define sentiment through your bot's word or phrase section in its Training & Chat Logs page. state Sentiment { pattern "i feel *" answer emote(); function emote() { var sentiment = input.getCorrectness(#emotion, "org.botlibre.emotion.Sentiment".toSymbol()); if (sentiment < 0) { return "Sorry to hear that. I hope you feel better soon."; } else if (sentiment > 0) { return "That is great! I am pleased to hear that."; } else { return "I am feeling okay as well."; } } }