live chat to chatbot transfer communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on intent Default_Fallback_Intent from SlackPlatform do | |
val reactSlackMap = session.get("react-slack-map") as com.google.common.collect.BiMap<String, String> | |
if(reactSlackMap !== null) { | |
val slackTs = context.get("slack").get("threadTs") as String | |
val reactChannel = reactSlackMap.inverse.get(slackTs) | |
if(reactChannel === null) { | |
if(slackTs.empty) { | |
/* | |
* No threadTs means we are in the top-level conversation | |
*/ | |
SlackPlatform.Reply("You cannot reply in the top-level conversation, please use the dedicated threads") | |
} else { | |
SlackPlatform.Reply("_Sorry, I cannot forward your message, the client may have closed the session_") | |
} | |
} else { | |
ReactPlatform.PostMessage("[Real Human " + context.get("chat").get("username") + "] " + intent.matchedInput, reactChannel) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment