Skip to main content

Slack Setup

Overview

The Slack channel connects Anyy to Slack DMs, channels, and threads. The adapter supports inbound media, thread context, lifecycle startup, and live-smoke checks.

Slack receiving uses Socket Mode when an app token is configured. The bot token is still required for Web API sends.

Prerequisites

  • A Slack app with a bot token.
  • An app-level token for Socket Mode if Anyy should receive messages.
  • The app installed into the workspace.
  • Channel membership wherever Anyy should answer.
  • Bot user id, if you want explicit self-message filtering.

Setup

Create credentials

Create a Slack bot token and, for resident receiving, an app-level token. Store both through Anyy secrets.

Configure Anyy

anyy setup channels slack \
--secret bot_token='xoxb-...' \
--secret app_token='xapp-...' \
--write-config

app_token is optional in the setup helper, but without it the resident Slack adapter has no Socket Mode receiver.

Defaults written by setup:

FieldDefault
account_idwork
dm_policypairing
group_policymention
media_max_bytes5242880

Optional runtime fields:

channels:
slack:
bot_user_id: "U0123456789"
send_chunk_chars: 3800

Start Gateway

anyy gateway start
anyy channels reload

Run doctor checks

anyy channels doctor slack

Access Policy

Direct messages

The setup default is dm_policy: pairing. Use allowlist and allow_from if only specific Slack users should reach Anyy.

Groups

The setup default is group_policy: mention. In Slack channels, Anyy answers only when mentioned unless you configure a broader policy.

Use allow_groups with channel ids when using allowlist.

Admins

Slack access policy decides which messages enter Anyy. Admin-like commands still use the shared messaging command authorization layer.

Sessions

Anyy keeps distinct sessions per Slack DM, channel, or thread. Thread timestamps are kept so replies can remain in-thread.

Media Support

Inbound media

Slack advertises inbound media support. Files are accepted up to media_max_bytes.

Outbound media

This adapter does not advertise native outbound media. Generated artifacts remain available in the session.

Commands

Use normal messaging commands such as /status in Slack. In channels, mention the bot when the group policy requires mentions.

Cron Delivery

anyy cron create \
--name "Slack digest" \
--schedule "0 9 * * *" \
--prompt "Post the daily digest" \
--delivery-target current_user_default \
--delivery-channel slack

Troubleshooting

  • Messages do not arrive: confirm Socket Mode is enabled and app_token_ref resolves.
  • Replies fail: confirm the bot token and channel membership.
  • Channel messages are ignored: mention the bot or adjust group_policy.
  • Unexpected sender accepted: use dm_policy: allowlist and allow_from.