From 2b9c1a594825e4413b0b0f145bf8bb511fdf5dbc Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Thu, 9 Apr 2020 22:02:25 -0700 Subject: [PATCH 1/6] updates after trying slack --- docs/user-guide/connectors/slack.rst | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index fe2ccf4ff001..0bad4c67da7f 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -17,19 +17,24 @@ Getting Credentials 1. To create the app go to https://api.slack.com/apps and click on **Create New App**. + 2. Activate the following features: - `Interactive Components `_ (if your bot uses any, e.g. buttons) - - Event subscriptions - - Bot users - - Permissions (for basic functionality you should subscribe to the - following events: ``message.channel``, ``message.groups``, - ``message.im`` and ``message.mpim``) + - Event subscriptions > Subscribe to bot events: chat.write, message.channels, message.groups, message.im & message.mpim + - App Home + - Always Show My Bot as Online - 3. Get the ``Bot User OAuth Access Token`` from the OAuth & Permissions page. You will need + 3. Get the ``Bot User OAuth Access Token`` from the OAuth & Permissions page. Click ``Install App to Workspace`` + and allow access to your workspace. You will need to provide this value in your credentials later in these instructions. It should start with ``xoxb``. + 4. The endpoint for receiving slack messages is ``http://localhost:5005/webhooks/slack/webhook``, replacing + the host and port with the appropriate values. This is the URL you should add in the "OAuth & Permissions" + "Redirect URLs" and "Interactivity & Shortcuts" + + 5. Go to the "Event Subscriptions" section, turn on the "Enable Events" and add the endpoint here also. For more detailed steps, visit the `Slack API docs `_. @@ -54,7 +59,8 @@ e.g. using: You need to supply a ``credentials.yml`` with the following content: - The ``slack_channel`` can be a channel or an individual person that the bot should listen to for communications, in - addition to the default behavior of listening for direct messages and app mentions, i.e. "@app_name". + addition to the default behavior of listening for direct messages and app mentions, i.e. "@app_name". To get the channel + id, right click on the channel choose Copy Link and the id will be the last component in the URL. - Use the entry for ``Bot User OAuth Access Token`` in the @@ -65,7 +71,7 @@ You need to supply a ``credentials.yml`` with the following content: slack: slack_token: "xoxb-286425452756-safjasdf7sl38KLls" - slack_channel: "#my_channel" + slack_channel: "C011GR5D33F" slack_retry_reason_header: "x-slack-retry-reason" # Slack HTTP header name indicating reason that slack send retry request. This configuration is optional. slack_retry_number_header: "x-slack-retry-num" # Slack HTTP header name indicating the attempt number. This configuration is optional. errors_ignore_retry: None # Any error codes given by Slack included in this list will be ignored. Error codes are listed `here `_. From 70b1da28abf7ec559ed20ba8b7d9ac4a3136a574 Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Tue, 14 Apr 2020 10:15:38 -0700 Subject: [PATCH 2/6] Update docs/user-guide/connectors/slack.rst Co-Authored-By: Ella Rohm-Ensing --- docs/user-guide/connectors/slack.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index 0bad4c67da7f..fa8095b3d9cc 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -20,7 +20,7 @@ Getting Credentials 2. Activate the following features: - - `Interactive Components `_ (if your bot uses any, e.g. buttons) + - Interactivity & Shortcuts > Interactivity (if your bot uses any `interactive components `_ , e.g. buttons) - Event subscriptions > Subscribe to bot events: chat.write, message.channels, message.groups, message.im & message.mpim - App Home - Always Show My Bot as Online @@ -81,4 +81,4 @@ The endpoint for receiving slack messages is ``http://localhost:5005/webhooks/slack/webhook``, replacing the host and port with the appropriate values. This is the URL you should add in the "OAuth & Permissions" section as well as -the "Event Subscriptions". \ No newline at end of file +the "Event Subscriptions". From 66f38ac12a578451d049ef69c7dcbe1535a3786a Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Tue, 14 Apr 2020 10:20:08 -0700 Subject: [PATCH 3/6] Remove chat.write --- docs/user-guide/connectors/slack.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index fa8095b3d9cc..8a8aab3f7285 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -21,7 +21,7 @@ Getting Credentials 2. Activate the following features: - Interactivity & Shortcuts > Interactivity (if your bot uses any `interactive components `_ , e.g. buttons) - - Event subscriptions > Subscribe to bot events: chat.write, message.channels, message.groups, message.im & message.mpim + - Event subscriptions > Subscribe to bot events: message.channels, message.groups, message.im & message.mpim - App Home - Always Show My Bot as Online From c40e1144e1319a6478fcba7a0b3a10455b3022cd Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Tue, 14 Apr 2020 10:21:15 -0700 Subject: [PATCH 4/6] Apply suggestions from code review Co-Authored-By: Ella Rohm-Ensing --- docs/user-guide/connectors/slack.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index 8a8aab3f7285..29eae60e64d3 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -22,16 +22,15 @@ Getting Credentials - Interactivity & Shortcuts > Interactivity (if your bot uses any `interactive components `_ , e.g. buttons) - Event subscriptions > Subscribe to bot events: message.channels, message.groups, message.im & message.mpim - - App Home - - Always Show My Bot as Online + - App Home > Always Show My Bot as Online 3. Get the ``Bot User OAuth Access Token`` from the OAuth & Permissions page. Click ``Install App to Workspace`` and allow access to your workspace. You will need to provide this value in your credentials later in these instructions. It should start with ``xoxb``. - 4. The endpoint for receiving slack messages is ``http://localhost:5005/webhooks/slack/webhook``, replacing - the host and port with the appropriate values. This is the URL you should add in the "OAuth & Permissions" + 4. The endpoint for receiving Slack messages is ``http://:/webhooks/slack/webhook``, replacing + the host and port with the appropriate values that point to your Rasa X or Rasa Open Source deployment. This is the URL you should add in the "OAuth & Permissions" "Redirect URLs" and "Interactivity & Shortcuts" 5. Go to the "Event Subscriptions" section, turn on the "Enable Events" and add the endpoint here also. From ec7415355c4ba117a795499dfd945783889491f6 Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Tue, 14 Apr 2020 10:37:44 -0700 Subject: [PATCH 5/6] Add URL in step 2 --- docs/user-guide/connectors/slack.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index 29eae60e64d3..bea262c13d77 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -21,6 +21,8 @@ Getting Credentials 2. Activate the following features: - Interactivity & Shortcuts > Interactivity (if your bot uses any `interactive components `_ , e.g. buttons) + - Add your Rasa request URL ``http://:/webhooks/slack/webhook``, replacing + the host and port with the appropriate values that point to your Rasa X or Rasa Open Source deployment. - Event subscriptions > Subscribe to bot events: message.channels, message.groups, message.im & message.mpim - App Home > Always Show My Bot as Online @@ -29,9 +31,8 @@ Getting Credentials to provide this value in your credentials later in these instructions. It should start with ``xoxb``. - 4. The endpoint for receiving Slack messages is ``http://:/webhooks/slack/webhook``, replacing - the host and port with the appropriate values that point to your Rasa X or Rasa Open Source deployment. This is the URL you should add in the "OAuth & Permissions" - "Redirect URLs" and "Interactivity & Shortcuts" + 4. In the "OAuth & Permissions > Redirect URLs" enter the endpoint for receiving Slack messages. This is + the same URL you entered above for Interactivity & Shortcuts -``http://:/webhooks/slack/webhook``. 5. Go to the "Event Subscriptions" section, turn on the "Enable Events" and add the endpoint here also. From 90fb3862d1f9d2ca6d22aca46880a0ee388842fa Mon Sep 17 00:00:00 2001 From: Ella Date: Tue, 28 Apr 2020 11:00:16 +0200 Subject: [PATCH 6/6] fix docs warnings --- docs/user-guide/connectors/slack.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/user-guide/connectors/slack.rst b/docs/user-guide/connectors/slack.rst index bea262c13d77..84e8a7260033 100644 --- a/docs/user-guide/connectors/slack.rst +++ b/docs/user-guide/connectors/slack.rst @@ -21,9 +21,9 @@ Getting Credentials 2. Activate the following features: - Interactivity & Shortcuts > Interactivity (if your bot uses any `interactive components `_ , e.g. buttons) - - Add your Rasa request URL ``http://:/webhooks/slack/webhook``, replacing - the host and port with the appropriate values that point to your Rasa X or Rasa Open Source deployment. - - Event subscriptions > Subscribe to bot events: message.channels, message.groups, message.im & message.mpim + - Add your Rasa request URL ``http://:/webhooks/slack/webhook``, replacing + the host and port with the appropriate values that point to your Rasa X or Rasa Open Source deployment. + - Event subscriptions > Subscribe to bot events: ``message.channels``, ``message.groups``, ``message.im``, ``message.mpim`` - App Home > Always Show My Bot as Online 3. Get the ``Bot User OAuth Access Token`` from the OAuth & Permissions page. Click ``Install App to Workspace`` @@ -32,7 +32,7 @@ Getting Credentials with ``xoxb``. 4. In the "OAuth & Permissions > Redirect URLs" enter the endpoint for receiving Slack messages. This is - the same URL you entered above for Interactivity & Shortcuts -``http://:/webhooks/slack/webhook``. + the same URL you entered above for Interactivity & Shortcuts - ``http://:/webhooks/slack/webhook``. 5. Go to the "Event Subscriptions" section, turn on the "Enable Events" and add the endpoint here also. @@ -62,7 +62,6 @@ You need to supply a ``credentials.yml`` with the following content: addition to the default behavior of listening for direct messages and app mentions, i.e. "@app_name". To get the channel id, right click on the channel choose Copy Link and the id will be the last component in the URL. - - Use the entry for ``Bot User OAuth Access Token`` in the "OAuth & Permissions" tab as your ``slack_token``. It should start with ``xoxb``.