docs: update README with Discord and multi-channel features
This commit is contained in:
87
README.md
87
README.md
@@ -7,11 +7,13 @@ Agentic coder with **Z.AI + Telegram integration** — Claude Code + Hermes in o
|
||||
## 🚀 Features
|
||||
|
||||
- **🤖 AI-Powered Code Generation**: Powered by Z.AI GLM-5.1 (Coding Plan)
|
||||
- **📱 Telegram Bot**: 24/7 live interaction via Telegram
|
||||
- **📱 Multi-Channel Bot**: Telegram + Discord with real-time delivery
|
||||
- **🛠️ Full Engineering Access**: Bash, FileEdit, WebSearch, Git tools
|
||||
- **🧠 Agent System**: Code reviewer, architect, DevOps engineer
|
||||
- **📚 Skills System**: Pre-built skills for common tasks
|
||||
- **⚡ Real-time Updates**: WebSocket-based live communication
|
||||
- **🔄 Self-Correction**: Automatic retry with backoff (2 retries)
|
||||
- **📦 Multi-Channel Delivery**: Hub-based message routing (Telegram + Discord + WebSocket + log)
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
@@ -67,14 +69,27 @@ node bin/zcode.js --dev
|
||||
node bin/zcode.js --no-bot
|
||||
```
|
||||
|
||||
## 🤖 Telegram Bot
|
||||
## 🤖 Telegram & Discord Bot
|
||||
|
||||
Once running, you can interact with zCode CLI X via Telegram:
|
||||
Once running, you can interact with zCode CLI X via multiple channels:
|
||||
|
||||
### Telegram
|
||||
1. Start the bot: `/start`
|
||||
2. Send your code requests or questions
|
||||
3. Receive AI-powered responses in real-time
|
||||
|
||||
### Discord
|
||||
1. Invite the bot to your server
|
||||
2. Send commands or questions
|
||||
3. Receive responses with full streaming support
|
||||
|
||||
### Multi-Channel Delivery
|
||||
Messages are automatically delivered to:
|
||||
- ✅ Telegram (primary)
|
||||
- ✅ Discord
|
||||
- ✅ WebSocket (real-time)
|
||||
- ✅ Log file (structured)
|
||||
|
||||
## 🛠️ Tools Available
|
||||
|
||||
- **Bash**: Execute shell commands
|
||||
@@ -98,24 +113,37 @@ Once running, you can interact with zCode CLI X via Telegram:
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
zCode CLI X uses a hybrid architecture combining:
|
||||
- **better-clawd**: Coding backbone (BashTool, FileEditTool, WebSearchTool, GitTool)
|
||||
- **Hermes Agent**: Agent system (Code Reviewer, Architect, DevOps)
|
||||
- **claudegram**: Bot patterns (grammy, deduplication, request queuing, multi-channel delivery)
|
||||
|
||||
### Core Components
|
||||
|
||||
```
|
||||
zcode-cli-x/
|
||||
├── bin/
|
||||
│ └── zcode.js # CLI entry point
|
||||
├── src/
|
||||
│ ├── api/
|
||||
│ │ └── index.js # Z.AI API adapter
|
||||
│ ├── bot/
|
||||
│ │ └── index.js # Telegram bot integration
|
||||
│ │ ├── index.js # Telegram bot (grammy-based)
|
||||
│ │ ├── deduplication.js # Message deduplication (60s TTL)
|
||||
│ │ ├── request-queue.js # Per-chat request queuing
|
||||
│ │ ├── message-sender.js # Message chunking (4k limit)
|
||||
│ │ ├── delivery-hub.js # Multi-channel delivery
|
||||
│ │ ├── discord.js # Discord integration (discord.js v14)
|
||||
│ │ └── self-correction.js # Self-correction wrapper (2 retries)
|
||||
│ ├── api/
|
||||
│ │ └── index.js # Z.AI API adapter (GLM-5.1)
|
||||
│ ├── tools/
|
||||
│ │ ├── BashTool.js # Shell command executor
|
||||
│ │ ├── FileEditTool.js # File operations
|
||||
│ │ ├── WebSearchTool.js # Web search
|
||||
│ │ └── GitTool.js # Git operations
|
||||
│ ├── skills/
|
||||
│ │ └── index.js # Skills system
|
||||
│ ├── agents/
|
||||
│ │ └── index.js # Agent orchestration
|
||||
│ ├── skills/
|
||||
│ │ └── index.js # Skills system
|
||||
│ └── utils/
|
||||
│ ├── logger.js # Winston logger
|
||||
│ └── env.js # Environment validation
|
||||
@@ -123,12 +151,32 @@ zcode-cli-x/
|
||||
└── package.json
|
||||
```
|
||||
|
||||
### Bot Flow
|
||||
|
||||
1. **Message Reception**: Telegram/Discord messages → `delivery-hub.js`
|
||||
2. **Deduplication Check**: `deduplication.js` (60s TTL)
|
||||
3. **Request Queue**: `request-queue.js` (per-chat sequential processing)
|
||||
4. **Self-Correction**: `self-correction.js` (2 retries + backoff)
|
||||
5. **Agent Execution**: better-clawd tools + Hermes agents
|
||||
6. **Response Delivery**: `message-sender.js` → Multi-channel (Telegram + Discord + WebSocket + log)
|
||||
|
||||
### Provider Support
|
||||
|
||||
- **Z.AI**: GLM-5.1 (Coding Plan) - Primary
|
||||
- **Claude**: Anthropic Claude (via API)
|
||||
- **OpenCode**: OpenCode CLI integration
|
||||
- **Kilo**: Kilo.AI gateway
|
||||
|
||||
## 🔗 Integrations
|
||||
|
||||
- **Z.AI API**: GLM-5.1 model with Coding Plan
|
||||
- **Telegram Bot API**: Webhook + WebSocket
|
||||
- **Express.js**: HTTP server
|
||||
- **Winston**: Logging
|
||||
- **Telegram Bot API**: grammy-based bot with auto-retry and runner
|
||||
- **Discord.js v14**: Discord bot with GatewayIntentBits
|
||||
- **Express.js**: HTTP server for webhook handling
|
||||
- **Winston**: Structured logging
|
||||
- **WebSocket**: Real-time updates
|
||||
- **Mongoose**: Database persistence
|
||||
- **Puppeteer**: Browser automation
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
@@ -137,14 +185,21 @@ zcode-cli-x/
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Configure `.env` with your credentials
|
||||
2. Configure `.env` with your credentials:
|
||||
```env
|
||||
GLM_BASE_URL=https://api.z.ai/api/coding/paas/v4
|
||||
ZAI_API_KEY=your_zai_api_key
|
||||
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
|
||||
TELEGRAM_ALLOWED_USERS=your_telegram_user_id
|
||||
DISCORD_TOKEN=your_discord_bot_token
|
||||
```
|
||||
|
||||
3. Run the bot:
|
||||
```bash
|
||||
node bin/zcode.js --bot
|
||||
```
|
||||
|
||||
4. Open Telegram and start chatting!
|
||||
4. Open Telegram and Discord to start chatting!
|
||||
|
||||
## 📝 License
|
||||
|
||||
@@ -178,9 +233,9 @@ MIT
|
||||
| Batch task processing | ✅ Batch skill (5-30 parallel subagents) | ✅ Parallel batch delegation | ❌ None |
|
||||
| **Platform** | | | |
|
||||
| Telegram integration | ✅ Native bot + webhook | ✅ 2-way Telegram bridge | ❌ None |
|
||||
| Discord | ❌ None | ✅ Full Discord integration | ❌ None |
|
||||
| Multi-channel delivery | ❌ Telegram only | ✅ Cron→Telegram/Discord/Email | ❌ None |
|
||||
| Voice I/O | ✅ Voice service (STT + TTS) | ✅ TTS + voice memos | ❌ None |
|
||||
| Discord | ✅ Native bot (via discord.js) | ✅ Full Discord integration | ❌ None |
|
||||
| Multi-channel delivery | ✅ Delivery hub (Telegram + Discord + WebSocket + log) | ✅ Cron→Telegram/Discord/Email | ❌ None |
|
||||
| Self-correction loops | ✅ Self-correction wrapper (2 retries + backoff) | ✅ Agent self-correction skill | ❌ None |
|
||||
| **Infrastructure** | | | |
|
||||
| Model routing | ✅ Multi-provider (OpenAI, Anthropic, Bedrock, custom) | ✅ Multi-provider routing | ❌ Single model |
|
||||
| Context compression | ✅ Compact pipeline (auto, micro, session memory) | ✅ lean-ctx MCP (90% savings) | ❌ None |
|
||||
|
||||
Reference in New Issue
Block a user