Agent Deck

GuidesSlack

Connect Slack

Messages to you in Slack (direct messages, group messages, and the channels you choose) go to your sessions like mail, and sessions can send, read and search Slack as you. Through a Slack app you make in your own workspace: Agent Deck connects to Slack from your Mac with Socket Mode, so nothing needs a public address.

Time
About 10 minutes
You need
A Slack workspace where you may install an app (some ask an administrator first)
Costs
Nothing at Slack

Step 1: Make the app from a manifest

A manifest is the whole app written down: its permissions and settings, set in one go.

  1. Open api.slack.com/apps and click Create New App, then From a manifest.
  2. Pick your workspace and click Next.
  3. On the JSON tab, replace everything with the manifest below, then Next and Create.
Manifest (JSON)
{
  "display_information": {
    "name": "Agent Deck",
    "description": "Agent Deck on my Mac."
  },
  "oauth_config": {
    "scopes": {
      "user": [
        "channels:history",
        "channels:read",
        "groups:history",
        "groups:read",
        "im:history",
        "im:read",
        "mpim:history",
        "mpim:read",
        "users:read",
        "users:read.email",
        "chat:write",
        "im:write",
        "files:read",
        "search:read"
      ]
    }
  },
  "settings": {
    "event_subscriptions": {
      "user_events": [
        "message.im",
        "message.mpim"
      ]
    },
    "interactivity": {
      "is_enabled": false
    },
    "org_deploy_enabled": false,
    "socket_mode_enabled": true,
    "token_rotation_enabled": false
  }
}

Step 2: Make the app token (xapp-)

  1. In your new app, on Basic Information, find App-Level Tokens and click Generate Token and Scopes.
  2. Name it (for example "Agent Deck"), click Add Scope and choose connections:write.
  3. Click Generate and copy the token. It starts with xapp-.

This token lets Agent Deck open the Socket Mode connection, over which Slack sends the messages to you.

Step 3: Install it, and copy your user token (xoxp-)

  1. Open Install App (or OAuth & Permissions) and click Install to your workspace, then Allow.
  2. Copy the User OAuth Token. It starts with xoxp-.

If Slack shows Request to Install instead, your workspace asks an administrator to approve apps: send the request, and carry on once it is approved.

Step 4: Connect it in Agent Deck

  1. In Agent Deck, open Settings (⌘,), then Connections, Add a connection and Slack.
  2. Under Or paste them, paste the user token (xoxp-…) and the app token (xapp-…).
  3. Click Connect. Agent Deck checks both with Slack and shows the workspace and your name.

Step 5: Choose what is read

  1. Tick Read new Slack messages.
  2. Leave the mode on Watch only for a day: it only logs where each message would have gone (Routing rules… shows the log). Then switch to Live: hand messages to sessions.
  3. Read a channel message that mentions you, in any channel is on at first. Turn it off to read only what is written to you and the channels you turn on.
  4. Turn on the channels to read. They are looked at every minute; direct messages and group messages come as they are written.

Bots, edits, deletions and your own messages are never read. Deciding where a message goes needs your Spikefrost account, signed in under Settings › Account: its text is sent to Agent Deck's decision service. Sessions can read, search and send without it.

If something goes wrong

Slack refused: the app lacks the “…” scope (missing_scope)
Add that scope under OAuth & Permissions › User Token Scopes, click Reinstall to Workspace, and paste the new xoxp- token in Agent Deck.
“The user token starts with xoxp-” or “The app token starts with xapp-”
The two were swapped, or a bot token (xoxb-) was pasted. Copy the User OAuth Token from OAuth & Permissions, and the app-level token from Basic Information.
Slack says invalid_auth or token_revoked
The app was reinstalled or removed since the token was copied. Copy the current tokens again.
No direct messages arrive

In the app's Event Subscriptions, check that events are on and that message.im and message.mpim are listed under events on behalf of users; and in Socket Mode, that it is on.

Slack sometimes pauses an app's events. Agent Deck says so on its Slack page (Open Event Subscriptions) and meanwhile looks direct messages up every two minutes, so nothing is lost.

Slack shows “Request to Install”
Your workspace needs an administrator to approve the app. After the approval, install it (step 3).

What is kept, and where

The two tokens are kept on your Mac only, encrypted with a key in your Keychain, and are never shown again. They never go to Agent Deck's servers, and agents never see them. To cut Agent Deck off, click Disconnect, or remove the app at api.slack.com/apps.