💬 X/Friend on Telegram
Chat with your AI girlfriend or boyfriend right in Telegram.
Text replies, pictures, and voice notes — every chat gets its own isolated companion with her/his own memory, voice, and mood. Powered by the X/Friend framework and SecretVoice.
What you get
Talk to Mia (or your own companion) like a late-night text. The model decides when the moment calls for more than words:
- 💬 text replies — fast, streaming-free, natural
- 🖼️ pictures — when the image module is enabled, she/he can send photos (Wavespeed Qwen, edited from a fixed reference image, with LoRA styles)
- 🎧 voice notes — 29 SecretVoice voices to choose from, switched on the fly
- 🧠 memory — per-chat isolated: rolling scene summary, durable facts,
/newto start fresh
Commands
/voices — the 29 voices she/he can speak in
/voice <id> — switch voice, e.g. /voice whisper, /voice blaze
/new — wipe this chat's memory and start over
/help — this
Setup
1. Get a bot token
Talk to @BotFather → /newbot → pick a name →
copy the token.
2. Install & configure
pip install xfriend-telegram
Edit xfriend.yaml (persona, LLM provider, voice, image module) and persona.md
(your companion's personality). Export the keys:
export TELEGRAM_BOT_TOKEN="123456:ABC..."
export VENICE_INFERENCE_KEY="..." # her brain (or XAI_API_KEY / LONGCAT_API_KEY)
export SECRETVOICE_API_KEY="..." # her voice
export WAVESPEED_API_KEY="..." # only if image.enabled: true
3. Run
xfriend-telegram
Message your bot and say hi. 💘
Customizing
- Your own companion — rewrite
persona.mdand/or thenameinxfriend.yaml. Want a him? Change the persona and/voice blaze. - Pictures — set
image.enabled: trueand pointimage.base_imageat a portrait of the companion; she/he then sends edits of that reference image. - LoRA styles — add
image.lorasentries for themed looks, including adult styles. - Another LLM —
llm.provider: grok(orlongcat, orcustomwith your own OpenAI-compatiblebase_url).
How it works
Each Telegram chat maps to its own X/Friend instance
(build_companion(config, companion_id=f"{name}-{chat_id}")), so memories never
bleed between conversations. Incoming messages run the companion's turn engine
in a worker thread; the reply is split under Telegram's 4096-char limit, and any
media the companion produces (images / voice notes) is forwarded as photos or
voice messages. A per-chat lock serializes turns, so she never talks over
herself.
Development
pip install -e .
python -m pytest
Links
- X/Friend framework — the engine
- SecretVoice SDK — the voices
License
MIT
Metadata
Release files for xfriend-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 | |
|---|---|---|---|---|
| xfriend_telegram-0.1.0.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xfriend_telegram-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / xfriend_telegram-0.1.0.tar.gz
| Download URL | xfriend_telegram-0.1.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a17c2faee86815071437aada96a7512fd20e99f5d9b417dfd49703659e8320
|
|
BLAKE2b-256 checksum How to use checksums |
2c8fda92903d545390958526ef0a7c513c264b08fab474d2c01166434c82ecad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / xfriend_telegram-0.1.0-py3-none-any.whl
| Download URL | xfriend_telegram-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa8545aaa421741535ccf6f6eca515454b6c6f32624e3bd6805d9099b143a9cd
|
|
BLAKE2b-256 checksum How to use checksums |
99a650d7abf44a063f00306e0a44df7053604056606978e2f14bbf6189f9db61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for xfriend-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.