Multi-Platform Messaging¶
Automate-E supports multiple messaging platforms. Agents work on Discord or Slack without code changes — just configure messaging.platform in character.json.
Supported Platforms¶
| Platform | Entry Point | Auth | Status |
|---|---|---|---|
| Discord | index.js (v1) or index-v2.js |
DISCORD_BOT_TOKEN |
Production |
| Slack | index-v2.js |
SLACK_BOT_TOKEN + SLACK_APP_TOKEN |
Production |
Configuration¶
New-style (recommended)¶
Use the messaging field for platform-agnostic configuration:
Legacy (Discord-only)¶
The discord field still works for backward compatibility:
If both messaging and discord are present, messaging takes precedence.
Discord Setup¶
See Discord Setup for the full guide.
Required env vars:
| Variable | Description |
|---|---|
DISCORD_BOT_TOKEN |
Bot token from Discord Developer Portal |
Required scopes: bot with permissions: Send Messages, Read Message History, Create Public Threads, Manage Threads, Add Reactions.
Required intents: Message Content, Server Members (privileged).
Slack Setup¶
1. Create Slack App¶
- Go to api.slack.com/apps → Create New App → From scratch
- Name your app (e.g.,
Conductor-E), select workspace
2. Enable Socket Mode¶
- Socket Mode → Enable
- Create App-Level Token with scope
connections:write - Save the
xapp-...token
3. Bot Permissions¶
OAuth & Permissions → Bot Token Scopes:
chat:write— Send messageschannels:read— Read public channel infochannels:history— Read public channel messagesusers:read— Get user display namesapp_mentions:read— Respond to @mentions
For private channels, also add:
groups:readgroups:history
4. Event Subscriptions¶
Event Subscriptions → Enable → Subscribe to bot events:
message.channels— Messages in public channelsapp_mention— When someone @mentions the bot
For private channels, also add:
message.groups
5. Install to Workspace¶
Install App → Install to Workspace → Copy the xoxb-... Bot User OAuth Token.
6. Invite Bot to Channel¶
In Slack: /invite @YourBot in the target channel.
Required env vars:
| Variable | Description |
|---|---|
SLACK_BOT_TOKEN |
xoxb-... Bot User OAuth Token |
SLACK_APP_TOKEN |
xapp-... App-Level Token (Socket Mode) |
Helm Values¶
Discord Agent¶
messagingPlatform: discord # or omit (default)
secrets:
existingSecret: my-agent-secrets
# Secret must contain: discord-bot-token, anthropic-api-key
Slack Agent¶
messagingPlatform: slack
command: ["node", "src/index-v2.js"]
secrets:
existingSecret: my-agent-secrets
# Secret must contain: slack-bot-token, slack-app-token, anthropic-api-key
Kubernetes Secret¶
kubectl create secret generic my-agent-secrets \
--from-literal=slack-bot-token='xoxb-...' \
--from-literal=slack-app-token='xapp-...' \
--from-literal=anthropic-api-key='sk-ant-...' \
--from-literal=database-url=''
Architecture¶
The messaging layer uses an adapter pattern:
character.json → messaging.platform
│
┌───────┴───────┐
▼ ▼
Discord Adapter Slack Adapter
(discord.js) (@slack/bolt)
│ │
└───────┬───────┘
▼
Message Handler
(platform-agnostic)
│
▼
Agent Loop
(agent.js)
Both adapters expose the same interface:
connect()— Connect to the platformonMessage(handler)— Register message handlersendReply(context, text)— Reply in threadsendToChannel(channel, text)— Send to a channeldisconnect()— Clean shutdown
The agent loop (agent.js) never touches platform-specific code.
Entry Points¶
| File | Messaging | Use When |
|---|---|---|
index.js |
Discord only (hardcoded) | Existing Discord agents (backward compat) |
index-v2.js |
Multi-platform (adapter) | New agents, or when using Slack |
gateway.js |
Discord only (split mode) | High-traffic Discord agents with Redis |
index-v2.js will become the default index.js in a future release once all existing agents are migrated.