Talk to agents in your chat app.
Attach Slack, 飞书, Telegram or 微信 bots to any agent. Every connection is outbound — Socket Mode, long connection, long polling — so you need no public URL, webhook or open port. Each thread becomes a DayMug conversation you can also open in the browser.
Where bots are configured
- Open the agent Settings → Agents → pick an agent (or New Agent) → edit.
- Add a bot under the attached-bots section, choose the platform, and fill in the credentials from the platform guides below.
- Click “Test connection” — a read-only check of the token, required scopes/permissions and platform switches. It sends nothing to any channel.
- Write channel rules — without a matching rule the bot stays silent (see Channel rules).
- Save — bots hot-reload; only bots whose credentials changed reconnect. The page shows each bot's live status, and failed connections retry automatically (5 s → 5 min back-off).
Per-bot options:
| Model | Model for new threads. Empty = the agent's default. |
| Maximum conversation duration | Default 12h, counted from a thread's first message. After it, the next message in the same thread starts a fresh conversation and session. 0 = reuse forever. |
| Unconfigured reply | Sent when someone @-mentions or DMs the bot where no rule covers them. No agent runs. |
| Unauthorized reply | Sent when someone outside allowed_user_ids @-mentions or DMs the bot. |
Slack
- Create an app at api.slack.com/apps and turn on Socket Mode. Generate an App-Level Token (
xapp-…) withconnections:write. - Bot Token Scopes:
app_mentions:read,chat:write,channels:history,groups:history,im:history,users:read. Addfiles:readto receive files andfiles:writeto send the agent's files back. - Event Subscriptions → bot events:
app_mention,message.channels,message.groups,message.im. - Install the app to get the Bot Token (
xoxb-…) and invite the bot to your channels. - In DayMug paste both tokens: Bot token =
xoxb-…, App-level token =xapp-….
飞书 / Feishu
- In the Feishu Open Platform create a custom app (企业自建应用) and enable the bot capability.
- Permissions:
im:message,im:message:send_as_bot,im:resource. Addim:message.group_msgto read every group message (needed forauto_reply). Optional:contact:user.base:readonlyso group members show by name instead of open_id. - Events: subscribe to
im.message.receive_v1using long connection (长连接) mode. - Publish a version, get it approved, and add the bot to your groups.
- In DayMug paste the App ID and App secret.
Telegram
- Message @BotFather, run
/newbot, and copy the token (123456789:AA…). - Run
/setprivacy→ your bot → Disable if you wantauto_replyin groups. With privacy on, the bot only sees commands, @-mentions and replies to itself — enough for mention-only use. - If the bot ever had a webhook, delete it (
deleteWebhook). A leftover webhook blocks long polling; "Test connection" reports it. - Add the bot to your group. Enable Topics in the group if you want one conversation per topic.
Conversations are per chat (a DM, a group, or a forum topic). Telegram offers no history API, so a new conversation starts at the triggering message, and messages sent while DayMug was restarting are not answered afterwards.
微信 / WeChat
WeChat uses Tencent's iLink Bot protocol: you pair a personal WeChat account by scanning a QR code — no official account, WeCom or reverse-engineered client involved.
- Add a bot, choose WeChat, and click pair. Scan the QR code with WeChat on your phone and confirm.
- New WeChat bots start with a rule that lets anyone DM the bot:
[{ "channel": "dm", "allowed_user_ids": ["*"] }]. Replace"*"with your own user id to keep it private. - WeChat has no threads. Send
/newto start a fresh conversation, or/new your questionto start one and ask in the same message. Other/commandspass through to the agent.
WeChat can't edit sent messages, so you'll see a typing indicator
and queue notices rather than a live-updating reply. If the
session expires (errcode -14) you need to scan again.
Group chats are not verified to work — treat WeChat as 1:1.
Channel rules
Each bot has a JSON array of rules deciding where
it answers and who may trigger it.
No matching rule means no reply — in groups and
DMs alike. Matching order: exact channel id first, then
"dm" / "*"; an exact rule with
"enabled": false overrides "*".
[
{
"channel": "C0123456789",
"require_mention": true,
"allowed_user_ids": ["U0123456789", "U0987654321"],
"extra_prompt": "This is the on-call channel. Keep answers short."
},
{ "channel": "*", "auto_reply": true },
{ "channel": "dm", "enabled": false }
]
| Field | Default | Meaning |
|---|---|---|
channel | required | Exact id — Slack C…/G…, Feishu oc_…, Telegram chat id (supergroups are negative, -100…). "*" = every group, "dm" = every direct message. |
enabled | true | Switch a rule off without deleting it. |
require_mention | true | In groups, only messages that @-mention the bot trigger it — including replies inside an existing thread. DMs are unaffected. |
auto_reply | false | Answer every message in the channel; overrides require_mention. |
allowed_user_ids | everyone | Only these platform user ids may trigger the agent. ["*"] or omitted = no restriction. |
extra_prompt | — | Extra system-prompt text for this channel only. |
allow_bot_mentions | false | Let other bots trigger this one (bot hand-offs, below). |
bot_mention_limit | 3 | Max bot-triggered runs per thread within the window. 0 blocks them. |
bot_mention_window_minutes | 30 | Length of that sliding window. |
Common rule sets
// Answer @-mentions in every group and in DMs
[{ "channel": "*" }, { "channel": "dm" }]
// Private assistant: only you, only in DMs
[{ "channel": "dm", "allowed_user_ids": ["U0123456789"] }]
// One busy channel answers everything; everywhere else stays quiet
[{ "channel": "C0123456789", "auto_reply": true }]What users will see
- Threads = conversations. A top-level message starts a thread; everything stays in it. When a bot is first @-mentioned in an existing Slack or Feishu thread, the earlier messages are pulled in as context.
- Live progress. Slack and Feishu show a progress message that updates with the agent's thinking and draft, then post the final answer as a fresh message that @-mentions the asker. Telegram edits one message in place.
- Queues are visible. If the account is busy, the bot says how many tasks are ahead and updates as the queue moves.
- Files. Images and files up to 25 MiB are passed to the agent. Files the agent publishes are uploaded back to the thread (Slack 1 GiB, Feishu 30 MiB, Telegram 50 MiB, WeChat 25 MiB).
- Web and chat stay in sync. Open the same conversation in DayMug; messages you send from the web are mirrored into the thread.
- A new message to the same bot in the same thread cancels its previous run and answers the latest one.
Bot hand-offs
One agent can pass a thread to another — e.g. a coder bot hands its
result to a reviewer bot. Turn on allow_bot_mentions
in the receiving bot's rule for that channel. The sending
agent ends its reply with a single line:
[HANDOFF @Reviewer] Please review the change in PR #42 against the spec in docs/spec.md
DayMug posts a real @-mention as the sending bot and starts the
receiving agent in its own conversation. Make the instruction
self-contained — the receiver does not see the sender's narrative.
bot_mention_limit stops two bots looping forever.
Troubleshooting
| Symptom | Check |
|---|---|
| Bot answers with the unconfigured reply (default: “🙇 不好意思,我还没有在这个会话里开通…”) | No rule matches — add the channel id, "*", or "dm". |
| Bot ignores messages without @ | Expected with require_mention. Use auto_reply (Telegram: also disable privacy mode; Feishu: add im:message.group_msg). |
| Telegram connected but silent | A leftover webhook — call deleteWebhook. Test connection shows it. |
| Feishu shows open_id instead of names | Grant contact:user.base:readonly. |
| Image-only message in a mention-only group is ignored | A bare image can't carry an @. Use auto_reply, or (Slack) add text with the @ in the same message. |
| Long tasks get cut off | im_run_timeout in config.yaml — 0s means no cap. |