You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/06/27 16:00:05 UTC

[camel] branch main updated: [Slack] Fix slack doc

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 97180b54f95 [Slack] Fix slack doc
97180b54f95 is described below

commit 97180b54f95e64fbe2560d3a7c487d195470b946
Author: Andrej Vano <av...@redhat.com>
AuthorDate: Mon Jun 27 13:22:47 2022 +0200

    [Slack] Fix slack doc
---
 .../org/apache/camel/component/slack/slack.json        |  2 +-
 .../camel-slack/src/main/docs/slack-component.adoc     | 18 +++++++++---------
 .../apache/camel/component/slack/SlackEndpoint.java    |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/components/camel-slack/src/generated/resources/org/apache/camel/component/slack/slack.json b/components/camel-slack/src/generated/resources/org/apache/camel/component/slack/slack.json
index 203728ef1c5..62489c393f9 100644
--- a/components/camel-slack/src/generated/resources/org/apache/camel/component/slack/slack.json
+++ b/components/camel-slack/src/generated/resources/org/apache/camel/component/slack/slack.json
@@ -29,7 +29,7 @@
     "webhookUrl": { "kind": "property", "displayName": "Webhook Url", "group": "webhook", "label": "webhook", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The incoming webhook URL" }
   },
   "properties": {
-    "channel": { "kind": "path", "displayName": "Channel", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The channel name (syntax #name) or slackuser (syntax userName) to send a message directly to an user." },
+    "channel": { "kind": "path", "displayName": "Channel", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The channel name (syntax #name) or slack user (syntax userName) to send a message directly to an user." },
     "token": { "kind": "parameter", "displayName": "Token", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The token to access Slack. This app needs to have channels:history, groups:history, im:history, mpim:history, channels:read, groups:read, im:read and mpim:read permissions. The User OAuth Token is the kind of token needed." },
     "conversationType": { "kind": "parameter", "displayName": "Conversation Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "com.slack.api.model.ConversationType", "enum": [ "PUBLIC_CHANNEL", "PRIVATE_CHANNEL", "MPIM", "IM" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "PUBLIC_CHANNEL", "description": "Type of conversation" },
     "maxResults": { "kind": "parameter", "displayName": "Max Results", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "10", "description": "The Max Result for the poll" },
diff --git a/components/camel-slack/src/main/docs/slack-component.adoc b/components/camel-slack/src/main/docs/slack-component.adoc
index e2cc64fd68d..e16d0356c26 100644
--- a/components/camel-slack/src/main/docs/slack-component.adoc
+++ b/components/camel-slack/src/main/docs/slack-component.adoc
@@ -14,10 +14,11 @@
 *{component-header}*
 
 The Slack component allows you to connect to an instance
-of http://www.slack.com/[Slack] and delivers a message contained in the
-message body via a pre
+of http://www.slack.com/[Slack] and to send and receive the messages.
+
+To send a message contained in the message body a pre
 established https://api.slack.com/incoming-webhooks[Slack incoming
-webhook].
+webhook] must be configured in Slack.
 
 Maven users will need to add the following dependency to their `pom.xml`
 for this component:
@@ -40,7 +41,7 @@ To send a message to a channel.
 slack:#channel[?options]
 ------------------------
 
-To send a direct message to a slackuser.
+To send a direct message to a slack user.
 
 -------------------------
 slack:@userID[?options]
@@ -148,7 +149,7 @@ For User tokens you'll need the following permissions:
 
 == Consumer
 
-You can use also a consumer for messages in channel
+You can also use a consumer for messages in a channel
 
 [source,java]
 ---------------------------------------------------------------------------------------------------------------------------
@@ -156,9 +157,9 @@ from("slack://general?token=RAW(<YOUR_TOKEN>)&maxResults=1")
     .to("mock:result");
 ---------------------------------------------------------------------------------------------------------------------------
 
-In this way you'll get the last message from general channel. The consumer will take track of the timestamp of the last message consumed and in the next poll it will check from that timestamp.
+This way you'll get the last message from `general` channel. The consumer will track the timestamp of the last message consumed and in the next poll it will consume only newer messages in the channel.
 
-You'll need to create a Slack app and use it on your workspace.
+You'll need to create a Slack app and use it in your workspace.
 
 Use the 'User OAuth Token' as token for the consumer endpoint.
 
@@ -191,7 +192,6 @@ For User tokens you'll need the following permissions:
 The naturalOrder option allows consuming messages from the oldest to the newest.
 Originally you would get the newest first and consume backward (message 3 => message 2 => message 1)
 
-IMPORTANT: You can use the conversationType option to read history and messages from a channel that is not only public
-(`PUBLIC_CHANNEL`,`PRIVATE_CHANNEL`, `MPIM`, `IM`)
+IMPORTANT: The channel / conversation doesn't need to be public to read the history and messages. Use the `conversationType` option to specify the type of the conversation (PUBLIC_CHANNEL,PRIVATE_CHANNEL, MPIM, IM).
 
 include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackEndpoint.java b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackEndpoint.java
index 6ee827cf9cf..ac89f4b696e 100644
--- a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackEndpoint.java
+++ b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackEndpoint.java
@@ -118,7 +118,7 @@ public class SlackEndpoint extends ScheduledPollEndpoint {
     }
 
     /**
-     * The channel name (syntax #name) or slackuser (syntax @userName) to send a message directly to an user.
+     * The channel name (syntax #name) or slack user (syntax @userName) to send a message directly to an user.
      */
     public void setChannel(String channel) {
         this.channel = channel;