Channels¶
Supported¶
- CLI
- Telegram
- Discord
- Slack (Socket Mode)
- WebSocket (minimal aiohttp channel for Web UI and API clients)
Additional adapters should live as plugins or future-hardening work, not as core runtime promises.
Telegram¶
- Create bot token with BotFather
- Add your numeric Telegram user ID to
channels.telegram.allowFrom - Restart gateway and verify in logs
WhatsApp¶
- Run
g-agent channels login - Scan QR in the bridge output
- Ensure your WA sender ID is in
channels.whatsapp.allowFrom - Keep bridge + gateway active (systemd user services recommended)
Check local bridge diagnostics with:
The WhatsApp row reports the bridge port listener, local listener pid when
available, whether whatsapp-auth exists, and whether bridgeToken is set.
Configuration¶
{
"channels": {
"whatsapp": {
"enabled": true,
"bridgeUrl": "ws://localhost:3001",
"allowFrom": ["628xxxxxxxxxx"],
"bridgeToken": "your-shared-secret"
}
}
}
Bridge authentication¶
Set bridgeToken to add a shared-secret auth gate on the WebSocket bridge. The Python client sends an auth message immediately after connecting; the Node.js bridge verifies it within 5 seconds or closes the connection.
- If
bridgeTokenis empty (default), the bridge accepts all connections (backward compatible). - The token is also passed as
BRIDGE_TOKENenv var when launching the bridge viag-agent channels login.
Voice notes¶
- Incoming voice/audio transcription uses Groq Whisper (
providers.groq.apiKeyorGROQ_API_KEY). - Generated
media_type: "voice"replies useedge-tts(Microsoft Neural TTS, default voiceid-ID-GadisNeural). Install viapip install edge-tts. - Falls back to
espeak-ng/espeakif edge-tts is not installed. ffmpegis required for OGG/Opus voice-note format (Telegram). If unavailable, g-agent auto-falls back to mp3/wavaudiooutput.
Discord¶
Discord uses the Discord Gateway websocket plus REST API replies.
Discord requirements¶
- Discord application and bot token from the Developer Portal
- Message Content Intent enabled when the character needs to read message text
- User ID allowlist in
channels.discord.allowFrom
Discord configuration¶
{
"channels": {
"discord": {
"enabled": true,
"token": "DISCORD_BOT_TOKEN",
"allowFrom": ["123456789012345678"],
"intents": 37377
}
}
}
Invite the bot to the server or DM it directly, then restart the gateway. Keep
allowFrom strict for any shared server.
Email¶
Bidirectional email channel using IMAP polling and SMTP replies.
Requirements¶
- IMAP-enabled mailbox (Gmail, Outlook, self-hosted)
- App password or OAuth credentials for SMTP relay
- Explicit consent: set
consent_granted: truein config
Configuration¶
{
"channels": {
"email": {
"enabled": true,
"consent_granted": true,
"imap_host": "imap.gmail.com",
"smtp_host": "smtp.gmail.com",
"imap_username": "you@gmail.com",
"imap_password": "your-app-password",
"smtp_username": "you@gmail.com",
"smtp_password": "your-app-password",
"from_address": "you@gmail.com",
"allow_from": ["trusted@example.com"],
"poll_interval_seconds": 30
}
}
}
Security notes¶
- The channel will not start unless
consent_grantedis explicitlytrue. - Use
allow_fromto restrict which senders the agent responds to. - Replies are threaded with the configured subject prefix (
Re:by default).
Slack (Socket Mode)¶
Real-time bidirectional Slack channel using Socket Mode (no public URL required).
Slack requirements¶
- Slack app with Socket Mode enabled
- Bot token (
xoxb-...) withchat:write,app_mentions:readscopes - App-level token (
xapp-...) withconnections:writescope
Slack configuration¶
{
"channels": {
"slack_channel": {
"enabled": true,
"bot_token": "xoxb-your-bot-token",
"app_token": "xapp-your-app-token",
"group_policy": "mention",
"dm": {
"enabled": true,
"policy": "open"
}
}
}
}
Policies¶
| Setting | Options | Description |
|---|---|---|
group_policy |
mention / open |
Respond to @mentions only, or all messages in channels |
dm.enabled |
true / false |
Enable or disable Slack DMs |
dm.policy |
open / allowlist |
Control DM access when DMs are enabled |
dm.allow_from |
list of Slack user IDs | Restrict DMs when policy is allowlist |
Channel troubleshooting¶
Use:
WebSocket¶
WebSocket channel exists as minimal aiohttp channel with local token auth and chat-id session mapping. Implemented for Web UI and API clients, not Nanobot full surface. Advanced Nanobot features missing: token issuance endpoint, media signing, SSL/TLS, capability registry entry gap.
Configuration:
{
"gateway": {
"enabled": true,
"host": "127.0.0.1",
"port": 8080,
"apiToken": "your-secret-token"
}
}
WebSocket endpoint: ws://127.0.0.1:8080/ws
Authentication: Send Authorization: Bearer your-secret-token header on connection.