Channels
Channels connect OpenMotoko to messaging platforms. Each channel implements the ChannelAdapter interface and translates platform-specific messages into a common format.
Supported channels
Section titled “Supported channels”| Channel | Library | Auth Method |
|---|---|---|
| Telegram | grammy | Bot token |
| Discord | discord.js | Bot token |
| whatsapp-web.js | QR session | |
| Slack | @slack/bolt | Bot + App tokens |
| Signal | signal-cli | Phone number |
| iMessage | BlueBubbles API | Server password |
| Google Chat | Google APIs | Service account |
| Microsoft Teams | Bot Framework | App ID + password |
| Matrix | matrix-js-sdk | User + password |
| Mattermost | REST API | Bot token |
| Feishu / Lark | Feishu API | App ID + secret |
| LINE | Messaging API | Channel token + secret |
| IRC | IRC client | Server + nick |
| Webchat | Built-in | No external deps |
Chat commands
Section titled “Chat commands”All channels support these slash commands:
| Command | Description |
|---|---|
/status | Show agent status |
/new | Start a new conversation |
/reset | Clear conversation history |
/compact | Summarize and compress context |
/model <name> | Switch model |
/think <level> | Set thinking depth |
/cost | Show token usage and costs |
/help | List commands |
Channel setup
Section titled “Channel setup”Telegram
Section titled “Telegram”- Create a bot with @BotFather
- Set
TELEGRAM_BOT_TOKENin your.env - Enable the Telegram channel in settings or
openmotoko.json
The adapter supports DMs, group messages, mention detection, and a 4096-character message limit.
Discord
Section titled “Discord”- Create an application at the Discord Developer Portal
- Add a bot and copy the token
- Set
DISCORD_BOT_TOKEN - Invite the bot to your server with message read/write permissions
Supports guild and DM messages, mentions, and media attachments (2000-character limit).
- Set
WHATSAPP_SESSION_PATH(default./data/whatsapp) - Start OpenMotoko and scan the QR code that appears in the logs
- Session persists across restarts
- Create a Slack app at api.slack.com/apps
- Enable Socket Mode and create an app-level token
- Set
SLACK_BOT_TOKEN(xoxb-...) andSLACK_APP_TOKEN(xapp-...)
Signal
Section titled “Signal”- Install
signal-clion your system - Register or link a phone number
- Set
SIGNAL_CLI_PATHandSIGNAL_PHONE_NUMBER
iMessage
Section titled “iMessage”- Run BlueBubbles Server on a Mac
- Set
BLUEBUBBLES_URLandBLUEBUBBLES_PASSWORD
Google Chat
Section titled “Google Chat”- Create a service account in Google Cloud Console
- Enable the Chat API
- Set
GOOGLE_CHAT_CREDENTIALS_PATHto the JSON key file
Microsoft Teams
Section titled “Microsoft Teams”- Register a bot in the Azure Bot Framework
- Set
TEAMS_APP_IDandTEAMS_APP_PASSWORD
Matrix
Section titled “Matrix”- Create a bot account on your homeserver
- Set
MATRIX_HOMESERVER,MATRIX_USER, andMATRIX_PASSWORD
Mattermost
Section titled “Mattermost”- Create a bot account in Mattermost
- Set
MATTERMOST_URLandMATTERMOST_TOKEN
Feishu / Lark
Section titled “Feishu / Lark”- Create an app in the Feishu developer console
- Set
FEISHU_APP_IDandFEISHU_APP_SECRET
- Create a Messaging API channel in the LINE Developer Console
- Set
LINE_CHANNEL_TOKENandLINE_CHANNEL_SECRET
- Set
IRC_SERVER,IRC_PORT,IRC_NICK, andIRC_CHANNEL - Default port is
6697(TLS)
Webchat
Section titled “Webchat”The built-in webchat channel works out of the box with no external dependencies. It is the web UI’s chat interface.
Channel plugin system
Section titled “Channel plugin system”You can extend OpenMotoko with third-party channel adapters via the plugin system.
openmotoko.config.ts
Section titled “openmotoko.config.ts”const config = { channelPlugins: [ { packageName: '@openmotoko/channel-rocketchat', config: { url: 'https://chat.example.com', token: 'bot-token', }, }, ],}
export default configPlugin API endpoints
Section titled “Plugin API endpoints”| Method | Path | Description |
|---|---|---|
GET | /api/channel-plugins | List installed plugins |
POST | /api/channel-plugins/install | Install by package name |
DELETE | /api/channel-plugins/:id | Remove a plugin |
Channel policy
Section titled “Channel policy”Each channel supports a per-channel policy in openmotoko.json:
{ "channels": { "telegram": { "enabled": true, "policy": { "dmPolicy": "allowlist", "allowFrom": ["123456789"], "requireMention": true } } }}| Policy | Description |
|---|---|
open | Accept messages from anyone |
pairing | Require a pairing code |
allowlist | Only accept from listed IDs |