← ClaudeAtlas

telegram-safetylisted

The rules that keep this personal Telegram account from being banned. Use whenever you touch sending, chunking, pacing, peer resolution, contacts, or any Telegram API call in this repository.
anrysys/tg-ai · ★ 0 · AI & Automation · score 72
Install: claude install-skill anrysys/tg-ai
# Telegram account safety This code drives a real person's personal account over MTProto. Getting it wrong does not fail a test - it gets the account restricted or permanently banned, and appeals are not guaranteed. Authority: [docs/10-product/srs.md](../../../docs/10-product/srs.md) `SPEC-SND-*` and [docs/70-ops/security.md](../../../docs/70-ops/security.md). ## The Send Guard - never weaken it `tg_send_message` sends nothing when the Peer is not the account itself, is not in the Peer Index, has no message history, **and** is not in contacts. **You may not** add a `force` / `skip_check` / `allow_unknown` parameter, send first and warn after, resolve the target another way to route around it, or suggest a workaround to the user. When it fires: tell the user, or call `tg_add_contact` if they already asked for exactly that. Reasoning and rejected alternatives: [ADR-0005](../../../docs/20-architecture/adr/0005-hard-block-send-to-unknown-peers.md). ## The constants are load-bearing | Constant | Value | Do not | | --- | --- | --- | | `MAX_CHUNK_CHARS` | 4000 | Raise it. Telegram's hard limit is 4096 and the margin absorbs client formatting | | `CHUNK_DELAY_SECONDS` | 2.5 | Lower it. Bursts to one peer are what rate limits react to | | `SYNC_DIALOG_DELAY_SECONDS` | 1.0 | Lower it. Rapid history requests read as automation | ## Error handling - Every tool is wrapped in `@guarded_tool` and returns text. Nothing raises. - Expected conditions: `raise ToolError("...")` - becom