feat: Discord integration + multi-channel setup wizard#9
Closed
unforsook wants to merge 2 commits intoTinyAGI:mainfrom
Closed
feat: Discord integration + multi-channel setup wizard#9unforsook wants to merge 2 commits intoTinyAGI:mainfrom
unforsook wants to merge 2 commits intoTinyAGI:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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