feat(channels): implement WhatsApp QR login proxy (#29)

This commit is contained in:
paisley
2026-02-10 14:06:53 +08:00
committed by GitHub
Unverified
parent 0cf4ad3a8c
commit 7a9fd7fc0f
8 changed files with 569 additions and 167 deletions

View File

@@ -10,7 +10,6 @@ export type ChannelType =
| 'whatsapp'
| 'telegram'
| 'discord'
| 'slack'
| 'signal'
| 'feishu'
| 'imessage'
@@ -81,7 +80,6 @@ export const CHANNEL_ICONS: Record<ChannelType, string> = {
whatsapp: '📱',
telegram: '✈️',
discord: '🎮',
slack: '💼',
signal: '🔒',
feishu: '🐦',
imessage: '💬',
@@ -99,7 +97,6 @@ export const CHANNEL_NAMES: Record<ChannelType, string> = {
whatsapp: 'WhatsApp',
telegram: 'Telegram',
discord: 'Discord',
slack: 'Slack',
signal: 'Signal',
feishu: 'Feishu / Lark',
imessage: 'iMessage',
@@ -180,51 +177,20 @@ export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
'Paste the bot token below',
],
},
slack: {
id: 'slack',
name: 'Slack',
icon: '💼',
description: 'Connect Slack using bot and app tokens',
connectionType: 'token',
docsUrl: 'https://docs.openclaw.ai/channels/slack',
configFields: [
{
key: 'botToken',
label: 'Bot Token (xoxb-...)',
type: 'password',
placeholder: 'xoxb-...',
required: true,
envVar: 'SLACK_BOT_TOKEN',
},
{
key: 'appToken',
label: 'App Token (xapp-...)',
type: 'password',
placeholder: 'xapp-...',
required: false,
envVar: 'SLACK_APP_TOKEN',
},
],
instructions: [
'Go to api.slack.com/apps',
'Create a new app from scratch',
'Add required OAuth scopes',
'Install to workspace and copy tokens',
],
},
whatsapp: {
id: 'whatsapp',
name: 'WhatsApp',
icon: '📱',
description: 'Connect WhatsApp by scanning a QR code',
description: 'Connect WhatsApp by scanning a QR code (no phone number required)',
connectionType: 'qr',
docsUrl: 'https://docs.openclaw.ai/channels/whatsapp',
configFields: [],
instructions: [
'Open WhatsApp on your phone',
'Go to Settings > Linked Devices',
'Tap "Link a Device"',
'Go to Settings > Linked Devices > Link a Device',
'Scan the QR code shown below',
'The system will automatically identify your phone number',
],
},
signal: {
@@ -465,7 +431,7 @@ export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
* Get primary supported channels (non-plugin, commonly used)
*/
export function getPrimaryChannels(): ChannelType[] {
return ['telegram', 'discord', 'slack', 'whatsapp', 'feishu'];
return ['telegram', 'discord', 'whatsapp', 'feishu'];
}
/**