中文 | English
Transmit WeChat messages on Telegram, supporting multiple WeChat protocols (iPad, Mac, Car, Windows, Pad)
Warning
According to feedback, the Windows protocol has the risk of account suspension, please do not use this protocol
First, copy .env.example to .env and configure the environment variables.
Copy app.conf.example to app.conf in the conf directory and set the Redis address to your deployed Redis address.
Create a docker-compose.yml file:
version: '3'
services:
wx2tg-v3:
image: finalpi/wechat2tg-v3:latest
container_name: wx2tg-v3
# ports:
# - "8056:8056" # Only needed for callback mode
volumes:
- ./config:/app/storage
- ./save-files:/app/save-files # After mounting save-files folder, sticker files do not need to be converted again
env_file: ".env"
restart: unless-stopped
depends_on:
- wx2tg-server
wx2tg-server:
# image: finalpi/wx2tg-server:v3-latest # v3 stable version
image: finalpi/wx2tg-server:v5-latest
container_name: wx2tg-server
ports:
- "8058:8058"
volumes:
- ./conf:/usr/wic-go/conf
restart: unless-stopped
depends_on:
- wx2tg-redis
wx2tg-redis:
image: redis:7.2
container_name: wx2tg-redis
ports:
- "16379:6379"
volumes:
- ./redis-data:/data
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
docker-compose up -d
Disable the bot's privacy mode. Open BotFather, enter /mybots, select your bot. Click Bot Settings - Group Privacy - Turn off. When Privacy mode is disabled for xxx appears, it means the disabling is successful.
/login: Get login QR code; the first person to send this command during initial deployment will become the bot owner
/logout: Logout and delete login cache
/update: Update group avatar and nickname information
/message: Toggle group message reception
/forward: Toggle forwarding of messages from other people or bots in the group
/user: Get WeChat user list; click the button to create a new group or bind a user (can search by name or remarks, e.g., /user Zhang to find WeChat users containing "Zhang")
/room: Get WeChat group list; click the button to create a new group or bind a WeChat group (can search by name or remarks, e.g., /room takeout to find WeChat groups containing "takeout")
/revoke: Revoke message (reply to the message to be revoked)
/relogin: Secondary login (use only when unexpectedly logged out after login, try to login with previously cached login information)
/getqr: Get personal QR code information
/settings: Program settings
/unbind: Unbind WeChat group or WeChat user (only supported in group usage)
/quit: Exit and disband group
| Name | Required | Description |
|---|---|---|
BOT_TOKEN | Yes | Telegram Bot token, created via BotFather |
API_ID | Yes | Telegram API ID |
API_HASH | Yes | Telegram API HASH |
DEVICE_TYPE | Yes | WeChat login protocol: ipad, car, mac, pad, win, ipadX |
BASE_API | Yes | wx2tg-server container API request address, full path required |
PROXY_PROTOCOL | No | Proxy type optional values (socks5, http, https) |
PROXY_HOST | No | Proxy URL |
PROXY_PORT | No | Proxy port number |
PROXY_USERNAME | No | Proxy username |
PROXY_PASSWORD | No | Proxy password |
ROOM_MESSAGE | No | Display format of WeChat group messages in Bot |
OFFICIAL_MESSAGE | No | Display format of official account messages in Bot |
CONTACT_MESSAGE | No | Display format of WeChat user messages in Bot |
ROOM_MESSAGE_GROUP | No | Display format of WeChat group messages in group |
CONTACT_MESSAGE_GROUP | No | Display format of WeChat user messages in group |
OFFICIAL_MESSAGE_GROUP | No | Display format of official account messages in group |
CREATE_ROOM_NAME | No | Format of group name when automatically creating WeChat groups |
CREATE_CONTACT_NAME | No | Format of group name when automatically creating WeChat contacts |
MESSAGE_DISPLAY | No | Display format of text messages |
/settingsWeChat emoji display as image links: When enabled, friend-sent Minions emojis will be converted to image links
Synchronize group information on startup: When enabled, all user information will be synchronized when the program starts, updating group avatars and names
Configure TENCENT_SECRET_ID and TENCENT_SECRET_KEY, which can be activated in the Tencent Speech Recognition Console. Free usage quota is available.
Enable automatic text-to-speech function in /settings
API_ID and API_HASHLog in to telegram account
Click "API development tools" and fill in application details (only application title and short name are required)
Finally, click "Create application"
If you want to modify the message sender's format, you can modify the environment variables in docker or the .env file
Custom message template placeholders:
#[alias]: Contact remarks
#[name]: Contact nickname
#[topic]: Group chat nickname
#[alias_first]: Remarks priority, if no remarks, display contact's nickname
#[identity]: Identity information text
#[body]: Message body text
#[br]: Line break
Send a message starting with @all to @everyone, only supports text messages @everyone
wx2tg-server needs to be in the same region as your login. If you encounter a verification code prompt, check if they are in the same region.
If not in the same region, you can configure WeChat proxy login in environment variables, or migrate already logged Redis data.
Fork the project, switch to the wx2tg-v3-dev branch, or create a new branch. Please do not directly submit code to the main branch.
Submit a Pull Request to the wx2tg-v3-dev branch
Thanks to Jetbrains for supporting this project
Content type
Image
Digest
sha256:e43df3300…
Size
543 MB
Last updated
7 months ago
docker pull finalpi/wechat2tg-v3