Chat Gateways
Arcana can act as an AI assistant inside Telegram, Discord, Slack, and WhatsApp. Each platform runs as a separate adapter; you can enable one or all simultaneously.
arcana gateway
Requires a Pro or Enterprise license. Complete arcana console login (or set ARCANA_LICENSE_KEY) before starting the gateway.
Configuration
Add a gateway block to ~/.arcana/config.json:
{
"provider": "openai",
"model": "gpt-4o",
"gateway": {
"telegram": { "token": "111:xxx", "allowedUsers": ["12345678"] },
"discord": { "token": "xxx", "allowedChannels": ["987654321"] },
"slack": { "botToken": "xoxb-xxx", "signingSecret": "xxx", "allowedChannels": ["C0123ABC"] },
"whatsapp": { "phoneNumberId": "123456", "accessToken": "xxx", "appSecret": "xxx", "allowedUsers": ["14155551234"] }
}
}
You can also pass tokens on the command line:
arcana gateway --telegram-token "111:xxx"
arcana gateway --discord-token "xxx"
Platform setup
Telegram
- Message @BotFather and create a new bot.
- Copy the bot token into your config.
- Add your Telegram user ID to
allowedUsers. Forward a message to @userinfobot or call the Bot APIgetUpdatesendpoint to findfrom.id.
Discord
- Create an application at discord.com/developers.
- Bot → copy the token. Enable Message Content Intent.
- Invite the bot with
Send Messages+Read Message History. - Add the channel ID to
allowedChannels.
Discord replies are capped at 2000 characters; longer responses are truncated.
Slack
- Create an app at api.slack.com/apps.
- OAuth scopes:
chat:write,channels:history,im:history. - Install the app and copy the Bot User OAuth Token (
xoxb-...) and Signing Secret. - Event Subscriptions: enable and request
message.channels/message.im. - Add the channel ID to
allowedChannels.
Uses the Meta Cloud API via webhooks (default port 3100).
- Create a Meta Business App and add the WhatsApp product.
- Copy Phone Number ID and Access Token into config. Set
appSecretfor production signature verification. - Expose the webhook (e.g.
ngrok http 3100) and configure the callback URL +messagessubscription in the Meta dashboard. - Add allowed phone numbers (country code, no
+) toallowedUsers.
WhatsApp messages are capped at 4096 characters.
Security
Allowlists (required)
Every platform requires an allowlist. The gateway refuses to start with an empty or missing allowlist unless ARCANA_GATEWAY_OPEN=1 is set (local dev only).
| Platform | Allowlist field | What to put |
|---|---|---|
| Telegram | allowedUsers | Telegram user IDs (numeric) |
| Discord | allowedChannels | Discord channel IDs |
| Slack | allowedChannels | Slack channel IDs (C0...) |
allowedUsers | Phone numbers with country code, no + |
WhatsApp webhook signatures
The adapter verifies x-hub-signature-256 using your appSecret. Required in production. Set ARCANA_WHATSAPP_INSECURE=1 only for local development.
Dev escape hatches
| Env / CLI | Effect |
|---|---|
ARCANA_GATEWAY_OPEN=1 | Allow empty platform allowlists (local dev only) |
ARCANA_WHATSAPP_INSECURE=1 | Skip WhatsApp signature verification (dev only) |
WHATSAPP_WEBHOOK_PORT | Override webhook listen port (default 3100) |
How it works
- Each platform gets its own adapter that translates messages to/from Arcana.
- Every chat ID gets its own agent session with conversation history and memory integration.
- Destructive shell commands are blocked by default.
- The agent has a capped tool-call budget per turn.
- Provider keys and model selection come from your main
~/.arcana/config.json.