A high-performance Discord bot daemon in Rust that bridges multiple coding-agent backends with a unified channel workflow.
- Multi-backend routing: Pi (RPC), OpenCode, Kilo, and Copilot.
- Per-channel config: backend, mention-only mode, and assistant display name via
/config. - File upload pipeline: attachments are staged locally, passed to backends with native/fallback handling, and auto-cleaned by TTL.
- Real-time streaming UI: thinking/tool status + incremental response rendering.
- Session lifecycle control: model switching, thinking level, compact/clear/abort.
- i18n: Traditional Chinese (
zh-TW) and English (en).
/config: Configure non-sensitive per-channel settings (backend, mention_only, assistant name)./agent: Switch backend for current channel./model: Switch model for current channel./thinking: Set thinking level (if backend supports it)./compact: Compact conversation context./clear: Clear current session state./abort: Abort current generation./skill: Load a skill (backend-dependent)./mention_only: Toggle mention-only mode./language: Switch bot UI language./cron,/cron_list: Manage scheduled prompts.
- Rust toolchain: https://www.rust-lang.org/tools/install
- Discord bot token
- At least one backend installed:
- Pi:
npm install -g @mariozechner/pi-coding-agent(https://github.com/mariozechner/pi-coding-agent) - OpenCode:
npm install -g @opencode-ai/cli - Kilo:
npm install -g @kilocode/cli - Copilot CLI (ACP):
npm install -g @github/copilot(or your distro package)
- Pi:
Enable these in Discord Developer Portal -> Bot:
- Required:
MESSAGE CONTENT INTENT
- Recommended:
SERVER MEMBERS INTENT
- Optional:
PRESENCE INTENT
botapplications.commands
Grant at least:
View ChannelsSend MessagesSend Messages in ThreadsEmbed LinksAttach FilesRead Message HistoryUse Application Commands
Optional but useful for broader server setups:
Manage MessagesAdd ReactionsUse External Emojis
From crates.io:
cargo install agent-discord-rsOr build from source:
git clone https://github.com/darkautism/pi-discord-rs.git
cd pi-discord-rs
cargo install --path .- Start once to generate config/data files:
agent-discord run- Edit config at:
~/.agent-discord-rs/config.toml
Set at minimum:
discord_token- optional
assistant_name
- Authorize channel/user:
- Mention the bot in target channel.
- Run returned auth command:
agent-discord auth <TOKEN_FROM_DISCORD>- If using Copilot backend, login once with the same Linux account as the bot service:
copilot login# foreground
agent-discord run
# systemd user service
agent-discord daemon enableMIT. See LICENSE.
If this project has saved you time or helped you in your workflow, consider supporting its continued development. Your contribution helps me keep the project maintained and feature-rich!