test-telegram
Skill2 starsChanged 2 days agoMITView on GitHub
Proves what the owner sees and taps in Telegram, first on the synthetic Bot API in tests, then on a live test bot before a release that touches ingress. Use when a change reaches the telegram package, cards, notices, fast commands or pairing.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-chainSkill
- add-mcp-toolSkill
- add-migrationSkill
- add-protocol-operationSkill
- add-venueSkill
- clean-diffSkill
- debug-failureSkill
- handle-security-reportSkill
- releaseSkill
- review-diffSkill
- review-money-pathSkill
- review-testsSkill
- run-testsSkill
- shape-commitSkill
- speed-up-testsSkill
- tune-ciSkill
- vet-releaseSkill
- write-adrSkill
- binference-toolsSkill
- copy-tradingSkill
- dca-planSkill
- meme-huntingSkill
- safe-swapSkill
- token-due-diligenceSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 47
Only for a release that touches ingress, and only by a maintainer with a test bot:
- Distinctive: line 60
Stop the engine and check that nothing still polls the bot.
- Distinctive: line 63
Write down what you saw on screen, step by step.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Telegram
The owner's Telegram chat is a key: a tap there confirms a trade. Every change to what the bot reads or sends is proven on the synthetic Bot API in CI. A release that changes ingress (polling, the webhook, pairing, screening, callbacks) also gets one run on a live bot.
1. The synthetic Bot API
createFakeBotApi() from @binference/telegram/testing answers grammY in memory, through its
fetch option or as the Http port. It behaves like Telegram where it matters to us:
- updates wait under Telegram's offset rules until a
getUpdatespasses them (push,pending); - a button press arrives as a
callback_query(press), and each press takes one answer; - HTML is parsed as strictly as Telegram does, with the 4,096-character and 64-byte callback limits;
- each message keeps its buttons through every edit (
messages,edits,deleted,answers); failNext(method, failure)makes the next call refuse with a status andretry_after, fail before it reaches Telegram (network), or succeed and lose its answer (lostAnswer).
2. Pick the test
| What changed | Where to prove it |
| A card, a receipt, a notice text | the module's test and its .zh.test.ts, then the message keys in i18n |
| A fast command or its button | packages/telegram/src/commands/, then compose-commands.test.ts in cli |
| Update intake and the poll worker | packages/telegram/src/updates/ and polling/, with the real worker started |
| Pairing, the owner check, secret screening | pairing/, ingress/, screening/ |
| A card from proposal to tap to fill | packages/cli/src/compose/compose-telegram.test.ts, mcp-paper-swap.test.ts |
| Delivery after a lost answer or a 429 | notices/ with failNext, then compose-notices.test.ts |
Assert what a person sees: the text a reader saw (sent()), the buttons, the edit, the deletion of
a pasted key, the answer to a press. Test a forged press too: another user, a group chat, data that
is not ours. Each must do nothing.
pnpm vitest run packages/telegram/src --maxWorkers=2
pnpm vitest run packages/cli/src/compose/compose-telegram.test.ts --maxWorkers=23. The live run before a release
Only for a release that touches ingress, and only by a maintainer with a test bot:
- A bot made for testing at BotFather, and a Telegram account that is not a real owner's. The
token goes into the keychain or a secret source of
config.json5, never into a file in the repo, a shell history or a log. - A scratch state folder (
BINFERENCE_HOME="$(mktemp -d)") and an agent in paper mode. No real wallet, no funds. - Set up, start and pair from the printed start link. Then check, in English and in Chinese:
- the command menu, and each fast command's reply;
- a paper swap's card, its tap, the receipt, and a tap after the card expired;
- a text shaped like a private key, deleted at once with a warning;
- a message from a second account and from a group, both ignored;
- a new pairing with
binference telegram pair, and the note the first owner gets.
- Stop the engine and check that nothing still polls the bot. Revoke the test token at BotFather if it was shown anywhere.
Write down what you saw on screen, step by step. A log line is not proof that a person saw it.
4. Report
The tests you ran and what they assert. For a live run: the version, each check of step 3 with what the chat showed, and the cleanup. Leave out tokens, ids of real accounts and chat text that is not from the test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

