Skip to content

Xatkit React Platform

Gwendal Daniel edited this page Aug 26, 2019 · 13 revisions

License Badge Build Status

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

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 log platform does not support any configuration option.

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
Clone this wiki locally