huxley-skill-telegram
Full-duplex Telegram voice + text for Huxley. Single Pyrogram userbot, p2p calls via py-tgcalls + ntgcalls.
Status: bundled with the Huxley repo as a workspace member. The most surface-area first-party skill — heavy native dependency, full-duplex audio bridging.
What it does
call_contact— "call mom" — dials a Telegram contact. Live PCM bridges through Huxley'sInputClaimmic/speaker plumbing.send_message— "tell mom I'll be late" — sends a text DM to the named contact via the userbot.answer_incoming_call/reject_incoming_call— wheninbound.enabled, the skill auto-answers (accepts immediately to preserve WebRTC audio quality) and announces viainject_turn. The two tools let the LLM accept/reject from the user's voice command.
Inbound text messages debounce-coalesce per sender: a chatty sender's "hola/papá/¿estás?" lands as one announcement, not three. Bounded backfill on connect: last N hours of unread messages from whitelisted contacts surface as a single coalesced announcement at session start.
Configure
Credentials live in <persona>/data/secrets/telegram/values.json (per-persona, gitignored, perms 0700/0600):
{
"api_id": "12345678",
"api_hash": "abcdef0123456789abcdef0123456789",
"userbot_phone": "+57..."
}
Get api_id + api_hash from my.telegram.org/apps. userbot_phone is the spare SIM the userbot signs in as — only consulted on first-run SMS auth, then the Pyrogram session file in <persona.data_dir>/ authenticates silently.
Resolution priority: ctx.secrets (preferred) → HUXLEY_TELEGRAM_* env vars (fallback) → persona.yaml (dev/test only). See docs/skills/telegram.md § Credentials for the full priority spec.
The rest of the config lives in persona.yaml:
skills:
telegram:
contacts:
mama: "+57..."
papa: "+57..."
inbound:
enabled: true
auto_answer: contacts_only # contacts_only | all | false
unknown_messages: drop # drop | announce
debounce_seconds: 2.5
backfill_hours: 6
backfill_max: 50
config_schema = None — contacts is a dict of user-defined keys, inbound is a nested object, first-time auth is an SMS-code flow. Doesn't fit JSON Schema. v2's PWA falls back to "edit YAML directly." See docs/skills/telegram.md for the full design.
Requirements
- Native dependency:
ntgcallsis a compiled C++ extension. First install on a Pi can take 60–90s; subsequent installs hit the wheel cache. - A spare Telegram-registered SIM for the userbot (NOT the user's own Telegram account — the userbot logs into its own account).
- Network access to Telegram's MTProto + p2p WebRTC peers.
Development
uv run --package huxley-skill-telegram pytest server/skills/telegram/tests
uv run ruff check server/skills/telegram
uv run mypy server/skills/telegram/src
Tests use a StubTransport so no pyrogram / py-tgcalls import is needed; the entire test suite runs offline.
License
MIT — see LICENSE.
Metadata
Release files for huxley-skill-telegram 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| huxley_skill_telegram-0.1.0.tar.gz | 48.3 kB | Without provenance | Details for huxley_skill_telegram-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| huxley_skill_telegram-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for huxley_skill_telegram-0.1.0-py3-none-any.whl |
Total release size: 83.8 kB
Release files / huxley_skill_telegram-0.1.0.tar.gz
| Download URL | huxley_skill_telegram-0.1.0.tar.gz |
|---|---|
| Size | 48.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8eac14c953b59ec5f2f17af08a2c30a5b019c4fa745759784434ff3e739c799
|
|
BLAKE2b-256 checksum How to use checksums |
999af42ae0940d017563d6e866a21dca531e869993c9cadc8e2675520ba4e452
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.5
|
Release files / huxley_skill_telegram-0.1.0-py3-none-any.whl
| Download URL | huxley_skill_telegram-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
449f9f3051a350377b2dfed57d499b43e5135a7de384614d777f27fe99350574
|
|
BLAKE2b-256 checksum How to use checksums |
c526c59228c17093178e6a0322751a176f23030533a2871c1773570777f95911
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.5
|
Security for huxley-skill-telegram 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.