Skip to content

EFB Docker image. 将微信中的聊天消息转发到telegram 🤤

License

Notifications You must be signed in to change notification settings

GilHogan/efb-wechat-docker-itchat-uos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

efb-wechat-docker-itchat-uos

将微信中的聊天消息转发到telegram 🤤

好处:

  • 可以完全关闭手机上的微信应用(禁用android上微信的自启权限,禁止微信后台运行)。android国产rom上如何开启telegram通知参考1 参考 2

注意:

  • 使用该项目,微信有被封禁风险,请自行判断是否使用 参考1 参考2
  • 如何减少封禁:项目尽量部署在你的本地(本市范围),如家里的树莓派等。并为该本地的网络环境配置可以访问telegram的代理。代理配置参考FQA

docker image

点击下面图标,跳转到docker hub

docker: image size

鸣谢

EFB Docker image with:

Features

Build

Use GitHub Action pre-build image

docker pull hogangolden/efb-wechat

Build image manually

git clone https://github.com/HoganGolden/efb-wechat-docker-itchat-uos.git
cd efb-wechat-docker-itchat-uos && docker build -t hogangolden/efb-wechat efb-wechat

Usage

Step 0

Create a Telegram Bot by talking to @BotFather and it will give you the Bot Token

Get your Telegram ID (Not username) from @getidsbot

Step 1

If you prefer to use docker.

# Create volumes
docker volume create efb-wechat-data

# Run 
docker run -d -t \
--name "efb-wechat" \
-e BOT_TOKEN=xxxx \
-e BOT_ADMIN=xxxx \
-v efb-wechat-data:/home/efb/efb_config/profiles/default \
hogangolden/efb-wechat

(Required) Use your Telegram Bot Token as BOT_TOKEN and your Telegram ID as BOT_ADMIN

If you prefer to use docker-compose.

mkdir efb-wechat && cd efb-wechat
wget https://raw.githubusercontent.com/HoganGolden/efb-wechat-docker-itchat-uos/main/docker-compose.yml -O docker-compose.yml

(Required) Modify the environment variables by editing docker-compose.yml, and then:

docker-compose up -d

raspberry pi os

docker compose up -d

Step 2

docker logs --tail=200 -f efb-wechat 
# Ctrl + C to quit after your log in

Scan the QR code to log in

Telegram 上机器人的设置

  • 允许 Bot 读取非指令信息,对 @botfather 说话: /setprivacy, 选择disable

  • 允许将 Bot 添加进群组,对 @botfather 说话: /setjoingroups, 选择enable

  • 允许 Bot 提供指令列表,对 @botfather 说话: /setcommands, 输入以下内容 (复制以下内容一次性发给botfather)

    help - Show commands list. link - Link a remote chat to a group. unlink_all - Unlink all remote chats from a group. info - Display information of the current Telegram chat. chat - Generate a chat head. extra - Access additional features from Slave Channels. update_info - Update info of linked Telegram group. react - Send a reaction to a message, or show a list of reactors. rm - Remove a message from its remote chat.

Configuration Options

BOT_TOKEN

(Required) Your Telegram bot token.

BOT_ADMIN

(Required) Your Telegram account id.

PROXY_URL

(Optional) Proxy url use to connect Telegram by network proxy.

Supported both http and socks5 proxy.

For example: http:https://172.17.0.1:1080

PROXY_USER

(Optional) Use for proxy authentication

PROXY_PASS

(Optional) Use for roxy authentication

SEND_IMAGE_AS_FILE

(Optional) Set the value to 0 to disable send all image messages as files (preventing Telegram’s image compression).

Enabled by default.

ANIMATED_STICKERS

(Optional) Set the value to 0 to disable support to animated stickers.

Enabled by default.

MESSAGE_MUTED_ON_SLAVE

(Optional) Behavior when a message received is muted on slave channel platform. Availiable value: normal, silent and mute. Go to ehForwarderBot/efb-telegram-master to get more information.

normal is the default value

YOUR_MESSAGE_ON_SLAVE

(Optional) Behavior when a message received is from you on slave channel platform. Availiable value: normal, silent and mute. Go to ehForwarderBot/efb-telegram-master to get more information.

silent is the default value

MP_GROUP_ID

(Optional) Telegram group id for forwarding every public account message to it. Go to efb-patch-middleware to get more information.

AUTO_MARK_AS_READ

(Optional) Set the value to 0 to disable auto mark as read in wechat phone client. Go to efb-patch-middleware to get more information.

Enabled by default.

REMOVE_EMOJI_IN_TITLE

(Optional) Set the value to 0 to disable remove emoji in telegram group title. Go to efb-patch-middleware to get more information.

Enabled by default.

STRIKETHROUGH_RECALL_MSG

(Optional) Set the value to 0 to disable strikethrough instead of replying to a recall message. Go to efb-patch-middleware to get more information.

Enabled by default.

FQA

How to use host machine proxy?

Try to set PROXY_URL as http:https://172.17.0.1:YOUR_PORT (Socks5 works as well)

  • 本人使用xray客户端做代理,需要配置为:大陆ip和域名直连,外网地址通过代理访问。客户端routing部分的配置参考如下:
{
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "outboundTag": "direct",
        "domain": [
          "geosite:cn",
          "geosite:private"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": [
          "geoip:private",
          "geoip:cn"
        ]
      }
    ]
  }
}

LICENSE

MIT

About

EFB Docker image. 将微信中的聊天消息转发到telegram 🤤

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 86.4%
  • Dockerfile 9.1%
  • Shell 4.5%