Skip to content

feat: add WeChat adapter via Tencent ClawBot API#73

Open
ikook-wang wants to merge 1 commit intoop7418:mainfrom
ikook-wang:main
Open

feat: add WeChat adapter via Tencent ClawBot API#73
ikook-wang wants to merge 1 commit intoop7418:mainfrom
ikook-wang:main

Conversation

@ikook-wang
Copy link
Copy Markdown

Summary

  • Add WeChat (微信) support as a skill-level adapter extension using Tencent's official ClawBot Bot API
  • New files: src/wechat-adapter.ts (BaseChannelAdapter impl), src/wechat-api.ts (API client)
  • Config: CTI_WECHAT_BOT_TOKEN, CTI_WECHAT_ALLOWED_USERS, CTI_ENABLED_CHANNELS=wechat

How it works

  • QR code login via ilinkai.weixin.qq.com to obtain bot_token
  • Long polling (getupdates) for inbound messages with cursor persistence
  • Reply via sendmessage with context_token from inbound message
  • Dedup logic to prevent duplicate sends from delivery layer
  • Token persisted to ~/.claude-to-im/data/wechat-token.json

Test plan

  • QR code login flow tested
  • Message receiving via long polling verified
  • Reply delivery to WeChat confirmed
  • Dedup prevents duplicate sends
  • Coexists with Telegram adapter (no interference)

Note: WeChat ClawBot API is currently in gray testing (灰测), not all users have access.

Add WeChat (微信) support as a skill-level adapter extension:
- wechat-api.ts: ClawBot API client (QR login, long polling, send message, typing)
- wechat-adapter.ts: BaseChannelAdapter implementation with dedup and auth
- config.ts: CTI_WECHAT_BOT_TOKEN / CTI_WECHAT_ALLOWED_USERS support
- main.ts: self-registration import

Uses the official WeChat Bot API (ilinkai.weixin.qq.com) with long-polling
for message consumption and context_token-based reply delivery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant