# Slack

Slack workspace — @mention the bot to query data, agent can post messages

- Category: Apps
- Runs in: the Phloem cloud

Ask Hamming questions in Slack by @mentioning your bot, and let Hamming and your alerts post to Slack channels.

## What you need
- A Slack app installed in your workspace, with the bot scopes `app_mentions:read`, `chat:write` and `im:history`
- The app's **Bot User OAuth Token** (`xoxb-…`), from its **OAuth & Permissions** page
- The app's **Signing Secret**, from its **Basic Information** page
- The app's Event Subscriptions pointed at Phloem, subscribed to bot mentions and direct messages

## Connect
1. In the console, open **Connectors**, choose **Add connector**, then **Slack**.
2. Enter **Bot Token** and **Signing Secret**.
3. Save and test. The test names the workspace and the bot, and says whether the bot can send notifications.

## What Hamming can do
- **Answer in Slack.** @mention the bot in a channel (`@Phloem what failed on stand 3 today?`) or send it a direct message. Hamming replies in the thread, with a **View full response in Phloem** link to the session.
- **Keep the conversation.** Each Slack thread is one Phloem session, so a follow-up in the thread continues it.
- **Post a message** to a channel, or as a thread reply. Each post needs your approval by default. An org admin can set **Changes** on the connector to **Off**, **Needs approval** or **Allowed**.

## Notes
- Questions asked in Slack run as the Phloem user who added the connector, whoever asks them.
- In a channel thread, @mention the bot on each message you want answered. In a direct message, every message is answered.
- A message sent while Hamming is still answering joins that reply instead of getting its own.
- When your workspace's monthly AI allowance is used up, the bot says so in the thread.
- Without the `chat:write` scope, the bot can listen but is not offered for alerts. Add the scope and test again.
- To send alerts to Slack, open **Alerts**, add a role, and choose this connector with a channel such as `#test-alerts`.

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Bot Token | Secret | Yes | Bot User OAuth Token from your Slack app's 'OAuth & Permissions' page. Requires app_mentions:read, chat:write and im:history scopes. |
| Signing Secret | Secret | Yes | Used to verify that inbound events really come from Slack. |
