Skip to content
Receive and send messages from our React-based chatbox
Java Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.util
platform
runtime
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
pom.xml

README.md

Xatkit React Platform

License Badge Build Status Wiki Badge

Receive and send messages from our React-based chat component. This platform is bundled with the Xatkit release.

The React platform is a concrete implementation of the ChatPlatform.

Providers

The React platform defines the following providers:

Provider Type Context Parameters Description
ChatProvider Intent - chat.channel: the identifier of the channel that sent the message
- chat.username: the name of the user that sent the message
- chat.rawMessage: the raw message sent by the user (before NLP processing)
Receive messages from a communication channel and translate them into Xatkit-compatible intents (inherited from ChatPlatform)
ReactIntentProvider Intent - react.channel: the identifier of the react channel that sent the message
- react.username: the name of the react user that sent the message
- react.rawMessage: the raw message sent by the user (before NLP processing)
Receive messages from the react component and translates them into Xatkit-compatible intents. Note that react.channel, react.username, and react.rawMessage contain the same values as chat.channel, chat.username, and chat.rawMessage
ReactEventProvider Event - Receive non-textual events from the react component and translates them into Xatkit-compatible events.

ReactEventProvider Events

Event Context Parameters Description
Client_Ready react - channel (String): the identifier of the react channel associated to the new client Event sent when a new react client connects to the Xatkit. Note: this event sets the context parameter react.channel, allowing to use a Reply action to post a message in response.
Client_Closed react - channel (String): the identifier of the react channel associated to the closed client Event sent when a react client disconnects from Xatkit. Note: this event sets the context parameter react.channel, but does not ensure that a Reply action invocation as a response to this event will be successful.

Actions

Action Parameters Return Return Type Description
PostMessage - message(String): the message to post
- channel (String): the identfier of the react channel to post the message to
The posted message String Posts the provided message to the given react channel (inherited from ChatPlatform)
Reply - message (String): the message to post as a reply The posted message String Posts the provided message as a reply to a received message (inherited from ChatPlatform)
ItemizeList - list (List): the list to itemize A String presenting the provided list as a set of items String Creates a set of items from the provided list. This actions relies on Object.toString() to print each item's content
ItemizeList - list (List): the list to itemize
- formatter (Formatter the formatter used to print each item
A String presenting the provided list as a set of items formatted with the given formatter String Creates a set of items from the provided list. This action relies on the provided formatter to print each item's content
EnumerateList - list (List): the list to enumerate A String presenting the provided list as an enumeration String Creates an enumeration from the provided list. This actions relies on Object.toString() to print each item's content
EnumerateList - list (List): the list to enumerate
- formatter (Formatter the formatter used to print each item
A String presenting the provided list as an enumeration formatted with the given formatter String Creates an enumeration from the provided list. This action relies on the provided formatter to print each item's content

Options

The React platform supports the following configuration options

Key Values Description Constraint
xatkit.react.client.url String The base URL of the website displaying the react chat component. Supports wildcard ("*") to allow any domain. Optional (default to <xatkit.server.public_url>:<xatkit.server.port>)
xatkit.react.port Integer The port used to start the socket server used by the React platform. Optional (default 5001)

Note: if the react platform is used as a concrete implementation of the ChatPlatform the following property must be set in the Xatkit configuration:

xatkit.platforms.abstract.ChatPlatform = com.xatkit.plugins.react.platform.ReactPlatform
You can’t perform that action at this time.