English | 中文
This project is based on wechaty and implements a WeChat message forwarding to Telegram bot using the puppet-wechat4u protocol UOS. Thus, it can circumvent the issue where some accounts are unable to log in to the WeChat web version.
- Forward WeChat individual messages, group messages, and official account messages to Telegram.
- Reply to messages on Telegram to specified users.
- Support group blacklist and whitelist modes.
- This project is intended only for technical research and learning and must not be used for illegal purposes.
- Please submit any issues you encounter to the issue tracker.
-
Install dependencies:
npm install
-
Configure the Telegram bot token and proxy information in the
.env
file. -
Run the program:
npm start
-
In Telegram, send
/start
to begin or/login
to log in.
docker run -itd --env BOT_TOKEN="" --env PROXY_HOST="" --env PROXY_PORT="" --env PROXY_USERNAME="" --env PROXY_PASSWORD="" --env PROXY_PROTOCOL="socks5" finalpi/wechat2tg:latest
create file docker-compose.yml
:
version: '3'
services:
wechat2tg:
image: finalpi/wechat2tg:latest
container_name: wx2tg
volumes:
- ./config:/app/storage
environment:
- BOT_TOKEN=
# - PROXY_HOST=
# - PROXY_PORT=
# 代理类型:socks5,http,https
# - PROXY_PROTOCOL=socks5
# 用户名密码可选
# - PROXY_USERNAME=
# - PROXY_PASSWORD=
restart: unless-stopped
docker-compose up -d
/login
: Retrieve the login QR code
/user
: Fetch the user list, click to reply
/room
: Fetch the group list, click to reply
/recent
: Fetch the most recent users or groups that have sent messages, click to reply
/setting
: Program settings:
Message mode switch:
Switch between blacklist or whitelist mode
Whitelist mode: Only receive messages from groups in the whitelist
Blacklist mode: Do not receive messages from groups in the blacklist
Feedback on successful delivery: Whether to provide feedback on the message delivery status
Automatic contact switch: Automatically switches back to replying to a user or group if they reply
Receive official account messages: Whether to accept messages from official accounts
BOT_TOKEN
(required): Telegram bot token, created via BotFather
Use a proxy to forward requests to the Telegram bot, leave blank if not using a proxy:
# Proxy configuration (optional)
# Protocol socks5, http, https
PROXY_PROTOCOL=socks5
PROXY_HOST=
PROXY_PORT=
PROXY_USERNAME=
PROXY_PASSWORD=
MIT
Thanks to JetBrains for supporting this project