Skip to content

Instantly share code, notes, and snippets.

View gdaniel's full-sized avatar

Gwendal Daniel gdaniel

View GitHub Profile
package com.xatkit.example;
import com.xatkit.core.XatkitCore;
import com.xatkit.plugins.react.platform.ReactPlatform;
import com.xatkit.plugins.react.platform.io.ReactEventProvider;
import com.xatkit.plugins.react.platform.io.ReactIntentProvider;
import lombok.val;
import org.apache.commons.configuration2.BaseConfiguration;
import org.apache.commons.configuration2.Configuration;
on intent SentimentDemo from ReactPlatform do
var sentiment = context.get("nlp")?.get("sentiment") as String
if(sentiment.equals("Very negative")) {
ReactPlatform.Reply("Ouch it hurts, sorry to disappoint you 😭")
} else if(sentiment.equals("Negative")) {
ReactPlatform.Reply("That's not really nice 😥")
} else if(sentiment.equals("Neutral")) {
ReactPlatform.Reply("That sentence felt pretty neutral to me, come on, don't be shy 😋")
} else if(sentiment.equals("Positive")) {
ReactPlatform.Reply("Ooh, thanks! That's very kind of you 🥰")