telegram-readonly
Original:🇺🇸 English
Translated
3 scriptsChecked / no sensitive code detected
Read the user's personal Telegram account in a controlled, read-only way via Telethon/MTProto. Use when you need to inspect Telegram chats, list dialogs, read recent messages from a specific chat, or search Telegram messages without relying on the Telegram Bot API. Do not use for sending, replying, editing, deleting, or any write action.
4installs
Sourceropl-btc/agent-skills
Added on
NPX Install
npx skill4agent add ropl-btc/agent-skills telegram-readonlyTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Telegram Readonly
Use the local skill script for Telegram reads from the user's personal account.
This skill exists because Telegram Bot API is the wrong tool for reading a real personal account. Use MTProto via Telethon instead.
Quick rules
- Use this skill only for reads.
- Do not improvise write actions.
- Do not add send/edit/delete logic to the wrapper unless the user explicitly asks.
- Treat the Telethon session like a high-privilege secret.
- Assume unread preservation is best-effort until tested on a real chat.
Local setup
Prefer the skill-local script and a skill-local virtual environment over any global CLI install.
Prefer saved Telegram config over shell-exported environment variables once setup is complete.
Treat as generated local state, not part of the skill itself.
If the installer drops skill-local dotfiles, the bootstrap script recreates automatically.
.venv.gitignoreBootstrap the local environment:
bash
<skill-path>/scripts/bootstrap_venv.shAfter bootstrap, use:
bash
<skill-path>/scripts/telegram-readonlyIf is missing later, just run the bootstrap script again.
.venvPrimary config path:
bash
~/.config/telegram-readonly/config.jsonRecommended one-time setup:
- Make sure and
api_idare available.api_hash - Run:
bash
<skill-path>/scripts/telegram-readonly authAfter successful login, the config file stores , , and the Telegram session string so future reads do not need exported shell variables.
api_idapi_hashCommands
Show built-in help
bash
<skill-path>/scripts/telegram-readonly helpAuthenticate once
bash
export TELEGRAM_API_ID='12345678'
export TELEGRAM_API_HASH='your_api_hash'
<skill-path>/scripts/telegram-readonly authList chats
dialogs --querynameusernametitlepetros skynetbash
<skill-path>/scripts/telegram-readonly dialogs --limit 50Read recent messages
bash
<skill-path>/scripts/telegram-readonly messages --chat '@username' --limit 50 --reverseSearch messages
bash
<skill-path>/scripts/telegram-readonly search 'invoice' --limit 50Restrict search to one chat:
bash
<skill-path>/scripts/telegram-readonly search 'deadline' --chat '@username' --limit 50List recent unread chats
Default behavior is opinionated: exclude muted and archived chats.
bash
<skill-path>/scripts/telegram-readonly unread-dialogs --limit 10Include muted and/or archived when needed:
bash
<skill-path>/scripts/telegram-readonly unread-dialogs --limit 10 --include-muted --include-archivedList recent unread DMs only
bash
<skill-path>/scripts/telegram-readonly unread-dms --limit 10Workflow
- Read if setup, auth, or unread-state behavior matters.
references/setup-and-safety.md - Ensure the skill-local virtual environment is bootstrapped.
- Ensure Telegram API credentials exist.
- Run once to create the session and write
auth.~/.config/telegram-readonly/config.json - Use ,
dialogs,messages,search, orunread-dialogsas needed.unread-dms - Keep usage narrow and intentional.
Expected outputs
The wrapper returns JSON. Parse it instead of relying on fragile text scraping.
Dialog objects include:
is_useris_groupis_channelis_botarchivedmuted- unread counters
Files
- Package repo:
https://github.com/ropl-btc/telegram-readonly-cli - Launcher:
scripts/telegram-readonly - Python implementation:
scripts/telegram_readonly.py - Local bootstrap:
scripts/bootstrap_venv.sh - Setup notes:
references/setup-and-safety.md - Config storage:
~/.config/telegram-readonly/config.json - is optional fallback only; it is not the preferred long-term setup.
.env - is generated local state and can be recreated with
.venv/.scripts/bootstrap_venv.sh
When to stop and ask
Stop and ask before:
- adding write capabilities
- enabling any background watcher/daemon
- broad exporting of large chat histories
- changing how secrets/session storage works