bot/docs/en/concepts/05-channel.md
Talk to your vikingbot through Telegram, Discord, WhatsApp, Feishu, Mochat, DingTalk, Slack, email, or QQ—wherever you are.
| Channel | Setup difficulty |
|---|---|
| Telegram | Easy (one token) |
| Discord | Easy (bot token + permissions) |
| Medium (scan a QR code) | |
| Feishu | Medium (app credentials) |
| Mochat | Medium (claw token + WebSocket) |
| DingTalk | Medium (app credentials) |
| Slack | Medium (bot + app tokens) |
| Medium (IMAP/SMTP credentials) | |
| Easy (app credentials) |
1. Create a bot
@BotFather./newbot and follow the prompts.2. Configure it
{
"channels": [
{
"type": "telegram",
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
]
}
You can find your user ID in Telegram settings. It is displayed as
@yourUserId. Copy the value without the@symbol into the configuration file.
3. Run it
vikingbot gateway
Mochat uses a Socket.IO WebSocket connection by default, with HTTP polling as a fallback.
1. Ask vikingbot to set up Mochat for you
Send the following message to vikingbot, replacing xxx@xxx with your actual email address:
Read https://raw.githubusercontent.com/HKUDS/MoChat/refs/heads/main/skills/vikingbot/skill.md and register on MoChat. My Email account is xxx@xxx Bind me as your owner and DM me on MoChat.
vikingbot automatically registers, updates ~/.vikingbot/config.json, and connects to Mochat.
2. Restart the gateway
vikingbot gateway
That is all—vikingbot handles the rest.
<details> <summary>Manual configuration (advanced)</summary>If you prefer to configure Mochat manually, add the following to ~/.vikingbot/config.json:
Keep
claw_tokensecret. It should only be sent to your Mochat API endpoint in theX-Claw-Tokenheader.
{
"channels": [
{
"type": "mochat",
"enabled": true,
"base_url": "https://mochat.io",
"socket_url": "https://mochat.io",
"socket_path": "/socket.io",
"claw_token": "claw_xxx",
"agent_user_id": "6982abcdef",
"sessions": ["*"],
"panels": ["*"],
"reply_delay_mode": "non-mention",
"reply_delay_ms": 120000
}
]
}
1. Create a bot
2. Enable intents
3. Get your user ID
4. Configure it
{
"channels": [
{
"type": "discord",
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
]
}
5. Invite the bot
bot scope.Send Messages and Read Message History permissions.6. Run it
vikingbot gateway
Requires Node.js 18 or later.
1. Link a device
vikingbot channels login
# In WhatsApp, scan the QR code from Settings → Linked devices
2. Configure it
{
"channels": [
{
"type": "whatsapp",
"enabled": true,
"allowFrom": ["+1234567890"]
}
]
}
3. Run it in two terminals:
# Terminal 1
vikingbot channels login
# Terminal 2
vikingbot gateway
Feishu uses a persistent WebSocket connection, so no public IP address is required.
1. Create a Feishu bot
im:message for sending messages.im.message.receive_v1 for receiving messages.
2. Configure it
{
"channels": [
{
"type": "feishu",
"enabled": true,
"appId": "cli_xxx",
"appSecret": "xxx",
"botName": "",
"encryptKey": "",
"verificationToken": "",
"allowFrom": [],
"threadRequireMention": true
}
]
}
In long-connection mode,
encryptKeyandverificationTokenare optional.allowFrom: leave it empty to allow every user, or add["ou_xxx"]to restrict access.botName: replaces@<open_id>mentions with the bot name in group-chat context sent to the model, and labels messages sent by the bot itself. When empty, it falls back to"Bot".threadRequireMention: controls whether group messages must mention the bot. The default istrue, meaning every message in regular groups and topic groups requires an@mention. When set tofalse, regular groups do not require a mention, and only the first message in a topic group can omit it; later replies still require an@mention outsideDEBUGmode.
3. Run it
vikingbot gateway
</details> <details> <summary><b>QQ (direct messages)</b></summary>[!TIP] Feishu receives messages over WebSocket, so you do not need a webhook or public IP address.
QQ uses the botpy SDK over WebSocket, so no public IP address is required. Currently, only direct messages are supported.
1. Register and create a bot
2. Set up the sandbox
3. Configure it
allowFrom: leave it empty for public access, or add user openids to restrict access. You can find a user's openid in the vikingbot logs after that user messages the bot.- For production, submit the bot for review and publish it in the console. See the QQ Bot documentation for the complete release process.
{
"channels": [
{
"type": "qq",
"enabled": true,
"appId": "YOUR_APP_ID",
"secret": "YOUR_APP_SECRET",
"allowFrom": []
}
]
}
4. Run it
vikingbot gateway
Send the bot a message from QQ. It should reply.
</details> <details> <summary><b>DingTalk</b></summary>DingTalk uses Stream Mode, so no public IP address is required.
1. Create a DingTalk bot
2. Configure it
{
"channels": [
{
"type": "dingtalk",
"enabled": true,
"clientId": "YOUR_APP_KEY",
"clientSecret": "YOUR_APP_SECRET",
"allowFrom": []
}
]
}
allowFrom: leave it empty to allow every user, or add["staffId"]to restrict access.
3. Run it
vikingbot gateway
Slack uses Socket Mode, so no public URL is required.
1. Create a Slack app
2. Configure the app
connections:write scope, and copy the token (xapp-...).chat:write, reactions:write, and app_mentions:read.message.im, message.channels, and app_mention, then save your changes.xoxb-...).3. Configure vikingbot
{
"channels": [
{
"type": "slack",
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-...",
"groupPolicy": "mention"
}
]
}
4. Run it
vikingbot gateway
Send the bot a direct message, or mention it in a channel. It should reply.
</details> <details> <summary><b>Email</b></summary>[!TIP]
groupPolicy:"mention"(default; reply only when mentioned),"open"(reply to every channel message), or"allowlist"(restrict replies to selected channels).- Direct messages are enabled by default. Set
"dm": {"enabled": false}to disable them.
Give vikingbot its own email account. It polls the inbox over IMAP and replies over SMTP, acting as a personal email assistant.
1. Get credentials (Gmail example)
[email protected].2. Configure it
consentGrantedmust betrueto allow mailbox access. This is a safety gate; set it tofalseto disable access completely.allowFrom: leave it empty to accept email from anyone, or restrict it to specific senders.smtpUseTlsandsmtpUseSsldefault totrueandfalse, respectively. Those defaults are correct for Gmail on port 587 with STARTTLS, so you do not need to set them explicitly.- If you only want to read and analyze email without sending automatic replies, set
"autoReplyEnabled": false.
{
"channels": [
{
"type": "email",
"enabled": true,
"consentGranted": true,
"imapHost": "imap.gmail.com",
"imapPort": 993,
"imapUsername": "[email protected]",
"imapPassword": "your-app-password",
"smtpHost": "smtp.gmail.com",
"smtpPort": 587,
"smtpUsername": "[email protected]",
"smtpPassword": "your-app-password",
"fromAddress": "[email protected]",
"allowFrom": ["[email protected]"]
}
]
}
3. Run it
vikingbot gateway