-
Notifications
You must be signed in to change notification settings - Fork 22
Xatkit Slack Platform
Gwendal Daniel edited this page Aug 26, 2019
·
10 revisions
Receive and send messages from Slack. This platform is bundled with the Xatkit release.
The Slack platform is a concrete implementation of the ChatPlatform.
The Slack 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) |
SlackIntentProvider | Intent | - slack.channel : the identifier of the Slack channel that sent the message- slack.username : the name of the Slack user that sent the message- slack.rawMessage : the raw message sent by the user (before NLP processing)- userId : the Slack unique identifier of the user that sent the message- userEmail : the email address of the Slack user that sent the message- slack.threadTs : the timestamp of the thread of the received message (empty if the message wasn't post in a thread)- slack.messageTs : the timestamp of the received message |
Receive messages from Slack and translates them into Xatkit-compatible intents. Note that slack.channel , slack.username , and slack.rawMessage contain the same values as chat.channel , chat.username , and chat.rawMessage
|
Action | Parameters | Return | Return Type | Description |
---|---|---|---|---|
PostMessage | - message (String): the message to post- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
The posted message | String | Posts the provided message to the given Slack 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). If the received message is contained in a thread the reply is appended to the same thread |
PostFileMessage | - message (String): the message to post with the file- file (File): the file to post- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
null |
null |
Posts the provided file with the provided message to the given Slack channel (the file title is automatically set with the name of the provided file ) |
PostFileMessage | - title (String): the associated to the file to post- message (String): the message to post with the file- content (String): the raw content of the file to post- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
null |
null |
Posts a file with the provided content and title to the given Slack channel
|
ReplyFileMessage | - message (String): the message to post with the file- file (File): the file to post |
null |
null |
Posts the provided file as a reply to a received message |
PostAttachmentsMessage | - attachments (List<Attachment>: the attachments to set in the message- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
null |
null |
Posts a message with the given attachments to the provided Slack channel
|
PostAttachmentsMessage | - pretext (String): the text to display before the attachment- title (String): the title of the attachment- text (String): the text of the attachment- attchColor (String): the color of the attachment (in HEX format)- timestamp (String): the timestamp associated to the attachment- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
null |
null |
Posts a message containing the given pretext with an attachment containing the provided title , text , attchColor , and timestamp to the given Slack channel
|
PostAttachmentMessage | - pretext (String): the text to display before the attachment- title (String): the title of the attachment- text (String): the text of the attachment- attchColor (String): the color of the attachment (in HEX format)- channel (String): the name or raw identfier of the Slack channel to post the message to (direct messages can be sent using the target username as channel name) |
null |
null |
Posts a message containing the given pretext with an attachment containing the provided title , text , and attchColor to the given Slack channel (the attachment timestamp is automatically set to the current date) |
ReplyAttachmentMessage | - attachments (List<Attachment>: the attachments to set in the message |
null |
null |
Posts a message with the given attachments as a reply to a received message |
ReplyAttachmentMessage | - pretext (String): the text to display before the attachment- title (String): the title of the attachment- text (String): the text of the attachment- attchColor (String): the color of the attachment (in HEX format)- timestamp (String): the timestamp associated to the attachment |
null |
null |
Posts a message containing the given pretext with an attachment containing the provided title , text , attchColor , and timestamp as a reply to a received message |
ReplyAttachmentsMessage |
pretext (String): the text to display before the attachment- title (String): the title of the attachment- text (String): the text of the attachment- attchColor (String): the color of the attachment (in HEX format) |
null |
null |
Posts a message containing the given pretext with an attachment containing the provided title , text , and attchColor as a reply to a received message (the attachment timestamp is automatically set to the current date) |
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 |
The Slack platform supports the following configuration options
Key | Values | Description | Constraint |
---|---|---|---|
xatkit.slack.token |
String | The Slack token used by Xatkit to deploy the bot | Mandatory |
xatkit.slack.ignore_fallback_on_group_channels |
Boolean | Specifies whether fallback intents should be ignored in group channels |
Optional (default false ) |
xatkit.slack.listen_mentions_on_group_channels |
Boolean | Specifies whether the bot should only listen to mentions in group channels |
Optional (default false ) |
Note: if the Slack 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.slack.platform.SlackPlatform
- Getting Started
- Configuring your bot
- Integrating an Intent Recognition Provider
- Adding a bot to your website
- Deploying on Slack
- Basic concepts
- Intents and Entities
- States, Transitions, and Context
- Default and Local Fallbacks
- Core Library