feat: Discord integration + multi-channel setup wizard#10
feat: Discord integration + multi-channel setup wizard#10unforsook wants to merge 1 commit intoTinyAGI:claude/convert-to-typescript-4q4Zkfrom
Conversation
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>
|
I realise Claude changed a bit more than I thought I had steered it to, I am not a big fan of complexity, but I guess adding multiple channels requires some extra conditionals. Let me know what you think @jlia0 |
It's pretty good overall, although it gets messy for the shell script with different channels, do you usually use agents with multiple channels or just single channel like discord |
|
Closing this PR after merging #12 |
yeah I usually use different channels, but tbh I think for simplicity, Discord DMs is completely fine here. Having tried it, perhaps I should remove the different channels code. You down for that? |
|
I'd really appreciate it if you could test #13! I made the multi channel support easier. |
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.
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//resetto clear conversation history.tinyclaw/modelconfig to switch between Sonnet (fast) and Opus (smartest) at runtime./tinyclaw.sh start, users are prompted to choose their channel (Discord / WhatsApp / Both) and model preference, persisted to.tinyclaw/channeland.tinyclaw/model./tinyclaw.sh setup— reconfigure channel and model at any time without editing files.envforDISCORD_BOT_TOKENand fails fast with a clear error if missingHow it works
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, callsclaude -c -pwith the configured model, and writes responses to.tinyclaw/queue/outgoing/where the originating client picks them up and replies.Files changed
src/discord-client.tssrc/queue-processor.tsMODEL_IDSmap) andgetModelFlag()for runtime model selectiontinyclaw.shsetupcommandpackage.jsondiscord.js+dotenvdependencies,discordnpm script.gitignore.tinyclaw/channel,.tinyclaw/model,.env.claude/hooks/session-start.sh🤖 Generated with Claude Code