Telegram · Create a Bot and Enter Token
Make sure you can already receive normal model replies in the local terminal or desktop client before configuring external chat apps.
- Search for the official @BotFather in Telegram, send
/newbot, follow the prompts to create a bot, and copy the HTTP API Token it gives you (this token acts as your bot's master key—never post it in public groups or screenshots); - Run the gateway setup wizard in your terminal (Windows desktop users can also fill this in directly on the "Settings → Model & Channels" page):
nyairo gateway setupChoose Telegram and paste the token you just received. Under "Allowed Users," enter only your own numeric Telegram User ID (note: not your @username or display name). If the wizard automatically displays Detected your Telegram user ID, verify it is accurate and confirm.
Telegram · Bind DM Memory Permissions
To prevent strangers who stumble upon your bot from accessing your private memories, nyairo requires you to explicitly specify which direct-message session has permission to read and write long-term memory.
If you installed using the default one-line script (data stored in ~/.nyairo), run the snippet below and enter your numeric DM User ID when prompted to compute the corresponding session key:
REL="$HOME/.local/share/nyairo/releases/v0.8.0"
PYTHONPATH="$REL:$REL/vendor/hermes" "$REL/vendor/hermes/.venv/bin/python" -c '
from gateway.config import Platform
from gateway.session import SessionSource, build_session_key
uid = input("Enter your numeric Telegram User ID: ").strip()
source = SessionSource(platform=Platform.TELEGRAM, chat_type="dm", chat_id=uid, user_id=uid)
print("Copy the session binding key below:")
print(build_session_key(source))
'Copy the printed key, then open ~/.nyairo/chiyo/config.json:
nano "$HOME/.nyairo/chiyo/config.json"Keep all other fields in the file unchanged, and set the telegram array under gateway_bindings to the key you just generated (Windows desktop users can simply check the session allowlist at the bottom of "Settings → Model & Channels"):
{
"gateway_bindings": {
"telegram": ["PASTE_THE_SESSION_KEY_PRINTED_ABOVE"]
}
}Telegram · Start the Gateway and Verify
Save and exit, then run the gateway to keep it online:
nyairo gateway runNote that only one gateway process can poll a given bot token at a time; if you see a 409 Conflict error, it means two gateway instances are running simultaneously (for example, the desktop app's background gateway plus a manual terminal window)—just stop one of them.
Open Telegram on your phone and send a few messages to your bot to verify everything works:
- Send a casual greeting and confirm you receive a reply;
- Send
/chiyo_statusand confirm it returns module status (Memory: READY); - Send
/chiyo_memory listto confirm DM memory permissions are properly bound (an empty list on a fresh install is normal).
Official QQ Bot Setup & Two Essential Gotchas
The underlying gateway includes a built-in official QQ Bot (API v2) adapter. If you want to chat with your companion in a QQ DM, visit the QQ Open Platform (q.qq.com) to create a bot and obtain its AppID and AppSecret. Enter and save them under "Connect QQ" in the Windows desktop client's "Settings → Model & Channels" page—the gateway will restart and connect automatically, displaying the actual connection result from the gateway logs directly in the UI.
If you edit configuration files manually, or run into "it says connected, but never replies," double-check these two verified gotchas:
- The config key must be
qqbot, notqq: Undergateway.platformsinconfig.yaml, the platform name is strictlyqqbot. If you mistakenly typeqq, the gateway silently ignores the entire section without printing even a single error line in the logs. - AppID and AppSecret alone are not enough—you must allowlist the specific DM session: nyairo's privacy gate only admits DM keys explicitly authorized in
gateway_bindings.qqbot(formatted asagent:main:qqbot:dm:YOUR_USER_ID). Before allowlisting, QQ messages reaching the gateway are quietly dropped—send one message to the bot first, then check off the newly appeared session in the desktop client's "Who Can Talk to Them" panel (or copy that key from the logs intochiyo/config.json) to start chatting normally.
Other Chat Platforms
- Personal WeChat (Easiest): Requires no developer portal registration or complicated IDs—just scan a QR code with mobile WeChat. See the previous chapter, Connect WeChat.
- Feishu (Lark) / WeCom / Discord, etc.: Although some third-party platform files exist in the underlying host codebase, we have not finished end-to-end testing of memory permission bindings and reconnect behavior for them, so they are not officially supported at this time.