Code Monkey home page Code Monkey logo

mautrix-wechat's Introduction

mautrix-wechat

A Matrix-Wechat puppeting bridge, based on https://github.com/ChisBread/wechat-box

Usage

Run wechat-service

Run bridge bot together with wechat box

If you only have one wechat account to bridge, it's recommended to run the bridge bot with wechat box in one docker container. First let's create a sample config

mkdir -p mautrix-wechat && cd mautrix-wechat
wget https://raw.githubusercontent.com/LeiShi1313/mautrix-wechat/main/mautrix_wechat/example-config.yaml -o config.yaml

then edit the config to suit your homeserver, you will need to change the admin account in wechat.boxes section, and geenrally you don't need maunal login option so remove the other demonstration box config. Now we start the wechat box:

docker run -d --name mautrix-wechat-box -v $(pwd):/data -p 8080:8080 -p 29380:29380  leishi1313/mautrix-wechat-box
docker exec -ti mautrix-wechat-box python -m mautrix_wechat -g

When the box is up, open localhost:8080/vnc.html to continue with the login process. Then copy the generated registration.yaml to your homeserver config, and restart your homeserver.

Run bridge bot and wecaht box seperatly

Run wechat box

Firstly, you need to have one or multiple wechat box running, to do that:

docker run -d --name wechat-service --rm  \
    -e HOOK_PROC_NAME=WeChat \
    -e HOOK_DLL=auto.dll \
    -e TARGET_AUTO_RESTART="yes" \
    -e INJ_CONDITION="[ \"\`sudo netstat -tunlp | grep 5555\`\" != '' ] && exit 0 ; sleep 5 ; curl 'http://127.0.0.1:8680/hi' 2>/dev/null | grep -P 'code.:0'" \
    -e TARGET_CMD=wechat-start \
    -v "$(pwd)/WeChat Files:/home/app/WeChat Files" \
    -p 8080:8080 -p 5555:5555 -p 5900:5900 \
    --add-host=dldir1.qq.com:127.0.0.1 \
    chisbread/wechat-service:latest

And then, go to localhost:8080/vnc.html to finish the login step.

You can start as many wechat boxes as you want.

Run mautrix-wechat

mkdir mautrix-wechat && cd mautrix-wechat
wget https://raw.githubusercontent.com/LeiShi1313/mautrix-wechat/main/mautrix_wechat/example-config.yaml -o config.yaml
docker run -d --name mautrix-wechat  -v $(pwd):/data leishi1313/mautrix-wechat 
docker exec -ti mautrix-wechat python -m mautrix_wechat -g

Now copy the generated registration.yaml to your homeserver config, and restart your homeserver.

TODO:

WeChat box

  • Auto reconnect

WeChat -> Matrix

  • 接收微信文本消息
  • 接收微信图片消息
  • 接收微信引用消息
    • 接收链接
    • 就收Quote消息

Matrix -> WeChat

  • 发送文本消息
  • 发送图片信息(可能无法做到)
  • 发送at消息
  • 从matrix端发送DM/群消息(matrix room未创建)

Docker

  • python not receiving SIGINT

mautrix-wechat's People

Contributors

leishi1313 avatar

Stargazers

Chuang Zhu avatar

Watchers

James Cloos avatar  avatar

mautrix-wechat's Issues

mautrix_wechat not in mautrix-wechat-box container

I ran

docker run -d --name mautrix-wechat-box -v $(pwd):/data -p 8088:8080 -p 29380:29380  leishi1313/mautrix-wechat-box
docker exec -ti mautrix-wechat-box python -m mautrix_wechat -g
> OCI runtime exec failed: exec failed: unable to start container process: exec: "python": executable file not found in $PATH: unknown

There is python3 available in there but when I run it I get the No module namet mautrix_wechat error:

docker exec -ti mautrix-wechat-box python3 -m mautrix_wechat -g
> /usr/bin/python3: No module named mautrix_wechat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.