feat: handle text document attachments from Telegram#32
Open
dmitryanchikov wants to merge 2 commits intomoazbuilds:masterfrom
Open
feat: handle text document attachments from Telegram#32dmitryanchikov wants to merge 2 commits intomoazbuilds:masterfrom
dmitryanchikov wants to merge 2 commits intomoazbuilds:masterfrom
Conversation
Download and serve text documents (code, configs, logs, etc.) to Claude via file path instead of injecting content into the prompt. This follows the same on-demand pattern used for images — safer and no size limit. - Detect text documents by MIME type and file extension - Download via Telegram getFile API to inbox/telegram/ - Pass file path, name, and size in the prompt - Claude reads the file on demand via Read tool Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude sometimes wraps HEARTBEAT_OK in backticks or bold markers. Strip leading formatting characters before the startsWith check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fenrur
added a commit
to Fenrur/claudeclaw
that referenced
this pull request
Mar 13, 2026
…zbuilds#35) - Delegate voice transcription to Claude via file path (no local whisper) - Parse rate limit reset time from Claude output - Global rate limit state to pause heartbeats/jobs - Voice directive [voice:/path] for TTS responses - Text document download and inline reading - Rate limit pre-check in Telegram handler Supersedes PRs moazbuilds#32, moazbuilds#33, moazbuilds#34. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a9afb06 to
765c2cb
Compare
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
Details
When a user sends a text file (
.py,.json,.yaml,.log, etc.) via Telegram, the bot now:inbox/telegram/This avoids injecting potentially large file contents directly into the prompt, which is both safer (no prompt injection from file contents) and more flexible (no size limit).
Test plan
.txtfile attachment — file downloaded and read correctly.cookies.txt— recognized as text, processed correctly🤖 Generated with Claude Code