OpenProgram Docs

Chat channels

A message to your bot runs an agent turn and the reply comes back in the same chat. Channels run inside the background service, so the conversation is live in Web and the TUI too.

Message Access allowlist or group lists Binding picks the agent Session key picks the conversation Turn reply in the same chat No binding: [no agent configured] Not allowed: pairing code in a direct message, no reaction in a group
  1. Message
  2. Accessallowlist or group lists

    Not allowed: pairing code in a direct message, no reaction in a group

  3. Bindingpicks the agent

    No binding: [no agent configured]

  4. Sessionkey picks the conversation
  5. Turnreply in the same chat
PlatformArrives viaLoginLive progressAttachments inFiles out
TelegramBot API long-pollingBot token from BotFatherYesPhotos, documents, voice, audio, video, GIFsPhoto, document
Discorddiscord.py GatewayBot tokenYesYesYes
SlackSocket Mode (slack_sdk)Bot token xoxb- and app token xapp-YesYes, files:readYes, files:write
WeChatiLink long-pollingQR scan with personal WeChatNo: cannot edit sent messagesImages, voice, files, videoImage, video, file

Releases and the complete source-development install include the Discord and Slack dependencies.

Quick start

You need an agent (openprogram agents add main) and a working model provider. The wizard picks a platform, logs in, binds an agent and starts the worker.

  1. openprogram channels setup
  2. Message your bot. The first reply is a pairing code.
  3. openprogram channels access approve <channel> <code>

The conversation then appears in the session list.

Platform setup

PlatformBefore running the wizard
Telegram@BotFather, /newbot, copy the token. No webhook or public IP.
DiscordCreate an app and bot at the Developer Portal. On Bot, enable Message Content Intent, or the gateway rejects the connection. Invite the bot to your server.
SlackCreate and install an app at api.slack.com/apps. Enable Socket Mode. Bot token scopes: chat:write, app_mentions:read and the history scopes for your events, such as im:history. App token under Basic Information → App-Level Tokens with connections:write. Subscribe to message and app_mention, the two the adapter handles. Both tokens are required.
WeChatPersonal WeChat, no Official Account. In Settings → Channels → Add bot, pick WeChat and Get QR code, or run the login command; scan with WeChat and confirm. An expired code is replaced with Get new code. The scanner is let in with no pairing code. Credentials persist until bot token invalid — relogin required. Uses Tencent's iLink backend; its terms are personal-use only.

Commands

Each --id is one bot login with its own credentials and bindings.

openprogram channels list                              # status of every account
openprogram channels accounts add telegram --id work   # create an account slot
openprogram channels accounts login telegram --id work # enter credentials (QR for wechat)
openprogram channels accounts rm telegram work         # delete account + its bindings

openprogram channels bindings add main --channel telegram            # catch-all → agent "main"
openprogram channels bindings add main --channel telegram \
    --account work --peer 123456 --peer-kind direct                  # one peer only
openprogram channels bindings list
openprogram channels bindings rm <binding_id>
TUI commandEffect
/login <channel>Enroll and wire to the current agent
/attach <channel> <peer>Route one peer into the current session
/detach, /connectionsUndo, list

Who can talk to your bot

Direct messages use pairing. An unlisted sender's message is dropped before any agent and the sender receives an eight-character code. Approval exists only as a local CLI or API call, so nothing typed in chat can approve anyone. There is no setting that turns the gate off.

openprogram channels access list                       # policy + allowlist + pending codes
openprogram channels access approve telegram K7XQ2MVR  # approve by pairing code
openprogram channels access allow telegram 123456789   # allowlist a user id directly
openprogram channels access revoke telegram 123456789  # remove a sender
  • Codes expire after one hour; a blocked sender gets the same code again, at most once a minute.
  • access allow adds a known platform ID without a code.
  • Everyone on the allowlist reaches the same agent and acts as you, and memory is one workspace for the instance. Keep it to people you would hand this machine to.

What approved senders may do

A direct-message turn has the same tools as the Web UI under that chat session's mode and rules, so in default Bypass permissions it can run commands here without a prompt. Approvals arrive as chat questions, answered with /answer.

openprogram channels accounts set wechat sender_access paired    # or: owner, the default (all channels)

paired limits everyone on the account to replies and memory, in direct messages and groups. For separate memory, someone runs their own instance:

openprogram --profile alice

Profiles

Group chats

Telegram, Discord and Slack. WeChat bots receive direct messages only.

SenderRepliesMemoryEvery tool, as you
Bound contact, or full accessYesYesYes
chat accessYesYesNo
Anyone elseNo reactionNoNo

Anyone else gets no reply, pairing code or error, and no conversation is created. A new group lists nobody.

openprogram channels accounts group-users add telegram 123456789 --access chat   # replies and memory only
openprogram channels accounts group-users add discord 80351110224678912 --access full  # runs as you
openprogram channels accounts group-users remove telegram 123456789
openprogram channels accounts group-users list telegram
openprogram channels accounts group-users add telegram 123456789 --access full --group -1001234567890
openprogram channels accounts group-users remove telegram 123456789 --group -1001234567890   # the group keeps its lists, even when empty
openprogram channels accounts group-users reset telegram --group -1001234567890              # use the account's lists again
  • First block: account-wide lists. Second: one group's lists, which replace the account's for that group; remove keeps the group's lists even when empty, and reset returns to the account's. Bound contacts keep full access. A Discord thread uses its parent's lists unless it has its own.
  • IDs are stable platform user IDs: numeric on Telegram and Discord (Developer Mode, Copy User ID), U… on Slack. The worker log names every ignored sender. Changes apply to the next message.
  • Settings > Channels holds the account-level lists; per-group lists are command-line only.
  • require_mention still applies: an unmentioned message from a listed person waits as context.
  • chat users cannot use /new, /reset, /activation, /memory, /stop or /help. What they write is context for later turns that run as you.
  • access revoke only touches the allowlist; use group-users remove for these lists. A bound contact cannot be chat: revoke first, which also ends their direct messages. Binding someone listed as chat takes them off the lists.
  • Nothing a sender types can change these lists.
Upgrading from a version with group_access

That setting is gone and a stored value is ignored. Teammates approved by pairing code from a group had replies and memory only; on the allowlist they now run as you in groups. Before upgrading, run openprogram channels access list, then for each teammate access revoke and group-users add <channel> <user id> --access chat.

Channels and environments

A channel decides where messages are mirrored; the conversation's project decides where tools run, on its machine. A conversation arriving from a channel is in the home project, on this computer; a bound conversation keeps its own project.

TopicBehaviour
Channel chipAbove the message box in Web and App, beside the machine chip: logo and account, or No channel. Dot: yellow degraded, red unreachable. Opens one row per app; pick an account to bind or switch, Disconnect to stop, Manage channels to add.
Bound WeChat accountYour WeChat's messages to the bot arrive here instead of a separate conversation. One conversation holds each person's chat on an account; picking the same person elsewhere moves it, and conversations with other people on that account stay. A pick with no known person takes the whole account. Disconnecting or switching returns messages to their usual conversation.
Replies in a bound conversationEvery assistant reply goes out, whatever started the turn: typing in the App, a Goal turn or a reminder. Only the reply: your typed message, tool progress and thinking stay in the App. An always-on check-in or a scheduled task sends its report instead, unless the Agent's Channels setting is off.
Approval pauseSends what was written before; after approval, only what follows
No recipientA Telegram, Discord or Slack account picked without a specific chat keeps replies in the App
Delivery failureThe App shows a notice with channel and error kind; the reply stays saved
Account statusSettings, Channels, one line per bot: Running, Turned off, Not signed in, Signed out (the token or login stopped working), Stopped by an error, Reconnecting, Not responding or Not started yet. A bad state says what to do, and the bot starts by itself after you sign in again.

Chats and sessions

PlatformOne session per
TelegramChat; group behaviour is per account (below)
Discord, Slack(channel, user): two senders in one channel get separate conversations and cannot see or answer each other's questions. Memory stays one workspace.
WeChatPeer
SettingEffect
session_scopeDefault per-account-channel-peer. Also per-channel-peer, per-peer, or main; each agent keeps its own sessions, so two agents on main never share one
session_daily_reset: "HH:MM", session_idle_minutesRotate daily or after idle time
/new, /resetFresh conversation now; the previous stays in the sidebar
Deleting in the Web UISame: the next message starts a new one

Who said it

Every channel message carries its sender, direct messages included (main puts peers together). Web, CLI and TUI turns have none.

{"speaker_kind":"human","speaker_id":"7391","speaker_display":"Ada","content":"the budget is 50k"}
{"speaker_kind":"human","speaker_id":"8022","speaker_display":"Bo","content":"make it 80k"}
  • The ID stays when someone renames and separates people with the same name; memory records each fact under who said it.
  • A display name is put on one line, capped at 64 characters, square brackets made round. Message text is kept exactly; typing a name in brackets does not impersonate.
  • The web transcript shows a small line above the bubble, such as WeChat · Ada; a WeChat sender has no nickname, so the ID is shortened to its first and last four characters.

Group behaviour

ModeBehaviour
alwaysEvery message starts a turn
mentionOnly an @mention or reply to the bot; the mention is stripped. The next turn gets the latest 50 other messages with senders, behind an "earlier messages in the chat" toggle in the web transcript.
ambientEvery message starts a turn and the agent decides whether to speak with chat_send. Replies to unaddressed messages stay in the web transcript as "overheard". No typing or ack reaction. Addressed messages are answered normally. Costs a model call per message.
openprogram channels accounts set telegram require_mention on       # or: off (also discord, slack)
openprogram channels accounts set telegram group_sessions per-user  # or: shared (telegram only)
  • require_mention sets the default: on is mention, off (default) is always.
  • Someone with full access uses /activation mention|always|ambient; alone it shows the mode. Direct messages are never gated.
  • group_sessions (Telegram; restart the worker): shared (default) or per-user.
  • Group members reach the agent's memory. /memory read stops writes, /memory off removes it, /memory on (default) follows the agent's setting. Direct messages always follow the agent.
  • Other bots' messages are ignored and duplicate deliveries start one turn. At most 10 turns a minute per group; the rest wait as earlier messages.

Chat commands

CommandEffect
/new, /resetFresh conversation
/stopStop the work running in this conversation at once. Where each person in a group has their own (Discord, Slack, Telegram per-user), only yours. Messages already waiting still run
/helpList these commands
/activation [mention|always|ambient]Show or switch the group's mode
/memory [on|read|off]Show or narrow the group's memory access
/answer <question_id> <choice>Answer a function's question (runtime.ask) or tool approval; free text allowed
/decline <question_id>Decline it

Work in a group without a mention; /new@yourbot works on Telegram. Only that chat's session questions can be answered; in a group, only by the person whose message started the turn.

Replies and progress

TelegramDiscordSlackWeChat
Typing shownYesYesNoYes
Progress⏳ working... edited live (⚙ bash → ✓ bash), then replaced by the replySameSameParagraph by paragraph, about 200 characters each; text before a tool goes first
FormatHTMLMarkdownmrkdwnPlain text
Split at4,0001,80039,0001,800
Delivery details
  • A long reply fills the placeholder then continues in new messages. A placeholder that cannot be edited falls back to a new message.
  • Slack threads and Telegram forum topics keep placeholder, reply, files and the agent's own notes and questions in place; a Telegram topic also shows typing there. A Slack thread reply also sent to the channel counts as a message.
  • Editing a Telegram message sent before the service started does nothing.
  • ack_reaction on (not WeChat) adds 👀 on pickup; Slack needs reactions:write.
  • A long code block stays closed in each message and reopens in the next. Discord replies never ping anyone, @everyone included. A photo Telegram refuses is sent as a file instead.
  • Rate-limited sends retry with Retry-After when given, up to three attempts, then log a structured error. A connection that could not be opened is retried up to four attempts; nothing reached the platform, so nothing arrives twice.
  • Crashed connection loops reconnect with backoff, 5 s doubling to 5 min. Invalid credentials stay down until you log in again; a Telegram token the API rejects counts. WeChat server errors wait and retry, 3 s doubling to 48 s.
  • The service checks accounts every few seconds: linking, logging in, enabling or disabling needs no restart.

A conversation runs one turn at a time, App turns included. While another turn runs or waits for an answer:

ArrivesWhat happens
A chat messageWaits up to 30 seconds, then the bot says it is busy. Send it again later.
An unaddressed group message, ambient modeNo reply; it joins the group's next turn.
Typing in the AppRefused, as during any other turn.
/new, /resetWait up to 30 seconds for a chat app turn, then the bot says it is busy.

Messages from one chat start turns in the order they arrived, even when an earlier one has a slow attachment. Commands do not queue.

Attachments

DirectionBehaviour
IncomingSaved to <state>/channels/<channel>/accounts/<account>/attachments/, 20 MB per file, listed as [attachment: <path> (<type>, <size>)]. Images up to 4 MB also reach the model. A file that could not be fetched leaves a line saying so.
Telegram voiceTurned into text with the engine in Settings → Voice and added to the message, caption kept. Needs ffmpeg; if transcription fails, the turn says why and the audio file is still attached.
WeChat mediaEncrypted from Tencent's CDN, decrypted on download. Voice arrives as WeChat's transcription when present, otherwise a .silk file the model cannot hear.
Replies to messagesQuoted text appears above as a > quoted block (Telegram, Discord reply; Slack thread)
OutgoingTelegram: photos or documents. Discord: upload with the caption. Slack: external upload, files:write. WeChat: encrypted, uploaded, sent by type, 100 MB, caption as a separate message. Only files the agent handed over with send_file upload; a marker it writes in its reply sends nothing and becomes a short note.
from openprogram.interfaces.channels.outbound import send_file
send_file("telegram", "default", "123456", "/path/to/report.pdf", caption="Weekly report")

Errors

What happenedWhat to do
Pairing code instead of an answeraccess approve <channel> <code> or access allow <channel> <user-id>
[no agent configured]openprogram agents add main, then channels setup or channels bindings add
account … has no bot_tokenopenprogram channels accounts login <channel> --id <account>
Slack account … needs both bot_token (xoxb-...) and app_token (xapp-...)Log in again and paste both
Discord channel requires discord.py, Slack channel requires slack_sdkIncomplete runtime: reinstall the release, or rerun the complete source-development installer
Discord connects but sees nothingEnable Message Content Intent
bot token invalid — relogin requiredopenprogram channels accounts login wechat --id <account> and rescan
adapter crashed … reconnecting in NsReconnects itself. Only adapter exited on its own needs action, usually a login.
"The reply was not delivered to WeChat (…)"auth: log in again. network, rate_limit: unreachable or throttled after retries. channels_unavailable: the process running the turn has no channels loaded. The reply is saved.
auth, rate_limit, bad_target in the logToken revoked or expired, rate limit (already retried), or wrong chat or channel ID

Channel design · Interfaces · Always-on Agents

Last updated · 2026-11-25