Matrix is an open network for secure, decentralized communication, which can be used similarly to Pidgin on your phone.
Pidgin tries to have all your friends in one place in Linux, regardless of what IM they use. With Matrix you can have your phone client connected to your private server which can all be highly customized. Matrix does not use the XMPP protocol, it uses a REST API so that it could be easier to extend.
The [Matrix] client Element is a universal secure chat app entirely under your control. It supports desktop (Windows, Mac and Linux) and mobile (Android and iOS)
What is matrix-appservice-wechaty
matrix-appservice-wechaty is a WeChat (微信) Matrix AppService for bridging your WeChat groups to Matrix rooms.
According to Types of Bridging, the Matrix Wechaty Bot implements a Simple Puppeted Bridge with Portal Rooms because we want to bring all conversations from WeChat to Matrix, and let the Matrix user control his account on Wechat.
Features
Supports connecting to Wechat via the Web/iPad/Hostie/Windows/Mac WeChat protocols, with the power of Wechaty
Maps all Wechat users/room/official accounts to Matrix virtual users
Requirements
A Matrix homeserver that supports application services (e.g. Synapse)
Note: The URL APP_SERVICE_ENDPIOINT is used by the home server to communicate with the appservice, in this example is: http://localhost:8788. If you have other appservices, or other requirements, pick an appropriate hostname and port.
3 Register the App Service
Edit your homeserver.yaml file and update the app_service_config_files entry with the path to the wechaty-registration.yaml file.
Direct Message Wechaty Bot (@wechaty:your.domain.ltd)
Send the message !login (three times… wip… )
The wechaty app service bot will then send you a QR Code for scanning on WeChat.
After you have scanned the QR Code and confirmed it on your phone, everything will be setup automatically by the wechaty bot.
Authentication
Logging in
Start a chat with the bridge bot. The bot should say “This room has been registered as your bridge management/status room.” if you started the chat correctly.
Run !login
Log in by scanning the QR code. If the code expires before you scan it, the bridge will send an error to notify you.
Open Wechat on your phone.
Tap Menu or Settings and select Scan.
Point your phone at the image sent by the bot to capture the code.
Finally, the bot should inform you of a successful login and the bridge should start creating portal rooms for all your Wechat groups and private chats.
Logging out
Simply run the !logout management command.
Setup Your Matrix Server
By following the guide from @spantaleev, you can set your matrix server up just in dozens of minutes.
This week I had a great talk with YC partner Eric @ericmigi, who is a serial entrepreneur and also a geek with technology. He uses Matrix a lot and almost integrated all the instance messanger to his Matrix.
But, the matrix does not support Wechat yet. So we’d like to introduce a matrix-wechat bridge to implement the Wechat protocol, and fill the gap between Matrix and Wechat.
@ericmigi provide some links that will help us to kick off a starter, hope we could make a workable POC soon, and any contribution will be welcome.
The names/avatars of Wechat users/groups are not set right on Matrix.
Only support text message, Image/Audio/Video message is not supported yet. (Will be supported in the future version)
Appservice will create more than one matrix room for a Wechat room when receiving messages from it for the very first time. (It will stop creating new rooms after you accepted the invitation)
Login QR Code should not use the 3rd party API for security considerations. A better way is to upload the QR Code image to matrix server instead.
v0.2 July 6, 2019
Enable your matrix account to start using matrix-appservice-wechaty by talk to the bot @wechaty:your.domain
After you talk to @wechaty, it will send you Wechat Login QR Code. Scan it to login Wechat
All Wechat messages will be bridged to the Matrix system, in the room that you talk to the bot at the very first time.
v0.0.1 May 2019
Auto response the message in a Matrix Room.
Disclaimer
I accept no responsibility if Tencent bans your IP, account or even your details on their system. They have never given official support on custom clients.
Wechaty community has setup the Matrix service(#94) which the server is sponsored by @ericmigi, who is the founder of Beeper, Partner of Y Combinator. He has also founded Pebble Technology (YC W11), which was acquired by Fitbit in 2016.
matrix-appservice-wechaty [
](https://matrix.to/#/#matrix-appservice-wechaty:matrix.org)
Wechat (微信) Matrix Application Service Bridge
What is [Matrix]
The [Matrix] client Element is a universal secure chat app entirely under your control. It supports desktop (Windows, Mac and Linux) and mobile (Android and iOS)
What is
matrix-appservice-wechatymatrix-appservice-wechatyis a WeChat (微信) Matrix AppService for bridging your WeChat groups to Matrix rooms.It has been officially listed at [Matrix] Bridge Page for Wechaty.
According to Types of Bridging, the Matrix Wechaty Bot implements a Simple Puppeted Bridge with Portal Rooms because we want to bring all conversations from WeChat to Matrix, and let the Matrix user control his account on Wechat.
Features
Requirements
Installation
matrix-appservcie-wechatyis all you need.1 Configure
config.yamlCopy config/config.sample.yaml to
config.yamland update it to match your setup.domainneeds to change to your domain name, which should point to your homeserver.homeserverUrlneeds to change to your homeserver url, with the port number included.registrationneeds to change to your registration yaml file name (see next part for how to generate it)2 Generate
wechaty-registration.yamlAfter we setup the
config.yaml, then we can generate thewechaty-registration.yamlfile for registering the appservice to the homeserver:Note: The URL
APP_SERVICE_ENDPIOINTis used by the home server to communicate with the appservice, in this example is:http://localhost:8788. If you have other appservices, or other requirements, pick an appropriate hostname and port.3 Register the App Service
Edit your
homeserver.yamlfile and update theapp_service_config_filesentry with the path to thewechaty-registration.yamlfile.4 Restart Home Server (Synapse)
You will then need to restart the synapse server.
For docker users:
Or if you are not using docker:
Remember to restart it every time the registration file is updated.
Launch the Wechaty AppService Bridge
Let’s start the
matrix-appservice-wechatybridge, with the port specified inwechaty-registration.yaml(8788in the above example)The bridge should start working shortly afterwards.
The current path (
$(pwd)) should have thewechaty-registration.yamlfile andconfig.yamlfile. Additional bridge-related data will be stored here.Examples
Example
wechaty-registration.yamlExample
config.yamlExample Docker Compose File
We have published a docker image wechaty/matrix-appservice for your convenience.
You can use docker to run matrix-appservice-wechaty bridge by adding the following configs to your
docker-compose.ymlBridge Usage
@wechaty:your.domain.ltd)!login(three times… wip… )wechatyapp service bot will then send you a QR Code for scanning on WeChat.After you have scanned the QR Code and confirmed it on your phone, everything will be setup automatically by the wechaty bot.
Authentication
Logging in
!loginLogging out
Simply run the
!logoutmanagement command.Setup Your Matrix Server
By following the guide from @spantaleev, you can set your matrix server up just in dozens of minutes.
TODO
Detail steps to setup the Matrix server from https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/README.md
See Also
Matrix AppService Bridges in TypeScript
Matrix AppService Bridges in JavaScript
Background
Todo/Question List
History
master
v0.9 Aug 1, 2021
Finished Display user’s nickname and avatar in group #66 and Support image and file messages #86.
v0.8 Mar 1, 2020
Finished #13: [TypeScript] Add typing system to
matrix-js-sdkandmatrix-appservice-bridge.!login,!logoutcommand with help messagev0.6 (Beta) Feb 25, 2020
v0.4 (Alpha) July 14, 2019
Known Issues
v0.2 July 6, 2019
matrix-appservice-wechatyby talk to the bot@wechaty:your.domain@wechaty, it will send you Wechat Login QR Code. Scan it to login Wechatv0.0.1 May 2019
Disclaimer
I accept no responsibility if Tencent bans your IP, account or even your details on their system. They have never given official support on custom clients.
Special Thanks
Wechaty community has setup the Matrix service(#94) which the server is sponsored by @ericmigi, who is the founder of Beeper, Partner of Y Combinator. He has also founded Pebble Technology (YC W11), which was acquired by Fitbit in 2016.
Learn more about Beeper from Beeper Brings iMessage to Android - No more green bubbles, LG’s exit, Android 12, Oneplus and Oppo
Maintainers
[Matrix] Server Admin:
Copyright & License