The Problem
Running a personal AI assistant on Telegram means juggling chat history, memory, file parsing, and image generation across multiple services. Without a structured setup, each conversation starts from zero, and every feature requires its own integration effort. This repo packages that into a single deployable bot.
What This Does
bot.cjs is a 3,699-line Telegram bot that connects Claude to chat, maintains a four-layer memory system (soul, projects, tasks, notes), and adds code tools, image generation via Gemini, and file parsing for PDF, ZIP, DOCX, and XLSX. It persists conversations, summaries, and vector embeddings in Supabase using the SQL in supabase setup.sql and supabase vector.sql.
The README.md documents a one-click Railway deploy and manual setup. railway.json holds the deployment config, and package.json declares the dependencies.
How It Is Wired
The bot has no internal module graph—it's a single file. Execution starts at bot.cjs, which handles Telegram updates, routes them through intent detection, and calls out to Anthropic, Supabase, Voyage AI, and Gemini. All effects (database writes, network calls, file parsing) flow through this one file.
bot.cjs carries the entire blast radius: 1,257 branch points and 3,699 lines mean any change touches decision logic, external API calls, and persistence in the same file. The wiring has not been mapped beyond this single module; there are no other code files to trace.
How To Use It
git clone https://github.com/moses-y/Claudebot-vibe
cd Claudebot-vibe
npm install
Configure required environment variables per the README: ANTHROPIC_API_KEY, SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, and TELEGRAM_BOT_TOKEN. Run the SQL in supabase setup.sql and supabase vector.sql in the Supabase SQL editor. Deploy via Railway using the button in the README, or run bot.cjs directly with Node. The README documents these steps; the repo has no lockfile, so npm install may pull different transitive versions than the author tested.
Real-World Use
A solo developer or small team runs this as a private Telegram assistant. A user sends a PDF; the bot parses it, stores a summary in user_docs, embeds the content in memories using the search_memories function, and answers follow-up questions with retrieval-augmented context from Claude. The /imagine command routes to Gemini for image generation.
Code Health & Issues
Static analysis found three issues, all in bot.cjs:
- High - Oversized file - 3,699 lines, hard to hold in one head; changes ripple widely. Fix: split into cohesive units by responsibility.
- Medium - Empty catch block - A
catch {}silently discards errors. Fix: handle, rethrow, or log. - Medium - High branching density - 1,257 branch points over 3,699 lines. Fix: decompose decision-heavy logic; consider table or strategy dispatch.
The analysis also flagged: no test files, no CI/CD pipeline, no LICENSE file, and no lockfile (non-reproducible builds). The dependency audit recommends committing a lockfile and enabling Dependabot or Renovate, since 1,322 repositories with manifests and no update bot means advisories sit unpatched.
The Bottom Line
This is a functional single-file bot that works, but the architecture is a maintenance liability: 3,699 lines of branching logic with no tests, no CI, and no lockfile. Use it if you want a working Telegram AI assistant quickly and accept the refactoring debt; avoid it if you need something you'll extend safely over time.