agent-discord-rs-0.2.2 is not a library.
Agent Discord (Rust)
A high-performance Discord Bot daemon developed in Rust, designed to bridge and manage multiple AI Agent backends.
Core Features
- Multi-backend Integration: Unified interface for managing Pi (CLI), OpenCode (API), Kilo (API), and Copilot (ACP) backends.
- Real-time State Rendering: Synchronized display of AI reasoning streams and tool execution (Tool Use) status.
- Session Lifecycle Management: Dynamic backend switching, model selection, thinking level configuration, and command-based context compression (
/compact). - I18n Support: Seamless switching between Traditional Chinese (zh-TW) and English (en), with automatic re-registration of Slash Commands to update localized descriptions.
Commands (Slash Commands)
/agent: Switch the active AI Agent backend./model: Switch the AI model used in the current channel./thinking: Set the AI thinking depth (subject to model capability)./compact: Manually trigger context compression to save tokens./language: Switch the bot interface language./clear: Completely wipe current session state and local JSONL history./mention_only: Toggle whether to respond only when mentioned (@).
Deployment
Prerequisites
- Rust Toolchain: Install via rust-lang.org.
- Discord Bot Token:
- Create an application at the Discord Developer Portal.
- Under Bot, enable the following Privileged Gateway Intents:
Presence Intent(Optional)Server Members IntentMessage Content Intent(Required)
- AI Backends: Install at least one of the following:
- Pi: github.com/mariozechner/pi-coding-agent
- OpenCode:
npm install -g @opencode-ai/cli - Kilo:
npm install -g @kilocode/cli - Copilot:
copilot(ACP backend, bot-managed lifecycle)
Installation
Install via crates.io:
Or build from source:
Initial Setup
- Generate Config: Run the bot for the first time to create the default config directory:
- Edit Config: Locate
config.toml(typically in~/.config/agent-discord-rs/config.toml) and paste yourdiscord_token. - Authentication:
- Invite the bot to your server.
- Mention (@) the bot in a channel to trigger the authentication prompt.
- Follow the instructions and run:
- Copilot one-time login (if using Copilot backend):
Running the Bot
# Start the bot
# Background daemon (Linux/Systemd)
Acknowledgments
This project relies on the following backends for its AI capabilities. Special thanks to the developers:
- Pi: The core for local automation and RPC calls.
- OpenCode: A robust HTTP/SSE backend with full tool-calling support.
- Kilo: A specialized backend implementation optimized for long-running sessions.
- Copilot: ACP backend support for GitHub Copilot workflows with bot-managed lifecycle.
License
This project is licensed under the MIT License. See the LICENSE file for details.