Skip to content

feat: Discord integration + multi-channel setup wizard#9

Closed
unforsook wants to merge 2 commits intoTinyAGI:mainfrom
unforsook:claude/convert-to-typescript-4q4Zk
Closed

feat: Discord integration + multi-channel setup wizard#9
unforsook wants to merge 2 commits intoTinyAGI:mainfrom
unforsook:claude/convert-to-typescript-4q4Zk

Conversation

@unforsook
Copy link
Copy Markdown

@unforsook unforsook commented Feb 9, 2026

Summary

Builds on top of the TypeScript conversion (#4) to add full Discord DM integration and an interactive setup wizard that lets users configure their preferred messaging channel and Claude model on first run.

  • New Discord client (src/discord-client.ts) — a Discord.js bot that listens for DMs, queues messages through the shared queue-processor, handles typing indicators, respects Discord's 2000-char limit with smart message splitting, and supports !reset//reset to clear conversation history
  • Configurable model selection — queue-processor reads from .tinyclaw/model config to switch between Sonnet (fast) and Opus (smartest) at runtime
  • Interactive first-run setup — on first ./tinyclaw.sh start, users are prompted to choose their channel (Discord / WhatsApp / Both) and model preference, persisted to .tinyclaw/channel and .tinyclaw/model
  • Dynamic tmux layouts — the daemon adapts its pane layout based on active channels: 4-pane grid for single channel, 5-pane layout when running both simultaneously
  • ./tinyclaw.sh setup — reconfigure channel and model at any time without editing files
  • Discord token validation — startup checks .env for DISCORD_BOT_TOKEN and fails fast with a clear error if missing

How it works

User DM ──► Discord Client ──► Queue (incoming/) ──► Queue Processor ──► Claude CLI
                                                                              │
User DM ◄── Discord Client ◄── Queue (outgoing/) ◄────────────────────────────┘

Both WhatsApp and Discord clients write JSON messages to .tinyclaw/queue/incoming/ with a channel prefix (discord_ / whatsapp_). The queue-processor picks them up FIFO, calls claude -c -p with the configured model, and writes responses to .tinyclaw/queue/outgoing/ where the originating client picks them up and replies.

Files changed

File What changed
src/discord-client.ts New — full Discord DM bot with typing indicators, message splitting, and queue I/O
src/queue-processor.ts Added model config reading (MODEL_IDS map) and getModelFlag() for runtime model selection
tinyclaw.sh Major overhaul — setup wizard, multi-channel support, dynamic tmux layouts, Discord validation, setup command
package.json Added discord.js + dotenv dependencies, discord npm script
.gitignore Added .tinyclaw/channel, .tinyclaw/model, .env
.claude/hooks/session-start.sh Added Discord mention to startup banner

🤖 Generated with Claude Code

claude and others added 2 commits February 9, 2026 11:17
Move whatsapp-client.js and queue-processor.js into src/ as TypeScript
files with proper type annotations, interfaces, and strict mode. Set up
tsconfig.json to compile to dist/, add build scripts, and update
tinyclaw.sh to reference compiled output and auto-build when source
changes.

https://claude.ai/code/session_01R6CxWY1dX5VRJWGAJmKohu
Add a full Discord bot client (discord-client.ts) that receives DMs,
queues them through the shared queue-processor, and sends responses
back — mirroring the existing WhatsApp flow. The queue processor now
supports configurable model selection (Sonnet/Opus) via a persisted
config file.

The main daemon (tinyclaw.sh) is overhauled with:
- Interactive first-run setup wizard (channel + model selection)
- Support for Discord-only, WhatsApp-only, or both simultaneously
- Dynamic tmux layouts that adapt to the active channels
- Discord bot token validation from .env
- A `setup` command to reconfigure channel/model at any time
- Status and logs commands that reflect all active channels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@unforsook unforsook closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants