{"id":13671420,"url":"https://github.com/wey-gu/chatroom-syncer","last_synced_at":"2025-07-09T04:04:56.069Z","repository":{"id":64853077,"uuid":"578437402","full_name":"wey-gu/chatroom-syncer","owner":"wey-gu","description":"Sync IM Chat Room to the public domain like IRC","archived":false,"fork":false,"pushed_at":"2023-01-05T15:20:15.000Z","size":216,"stargazers_count":45,"open_issues_count":10,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-09T04:04:54.325Z","etag":null,"topics":["github-bot","slack-bot","wechat"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wey-gu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-15T03:45:54.000Z","updated_at":"2024-12-28T04:02:16.000Z","dependencies_parsed_at":"2023-02-04T06:46:44.888Z","dependency_job_id":null,"html_url":"https://github.com/wey-gu/chatroom-syncer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/wey-gu/chatroom-syncer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wey-gu%2Fchatroom-syncer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wey-gu%2Fchatroom-syncer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wey-gu%2Fchatroom-syncer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wey-gu%2Fchatroom-syncer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wey-gu","download_url":"https://codeload.github.com/wey-gu/chatroom-syncer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wey-gu%2Fchatroom-syncer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264390668,"owners_count":23600560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-bot","slack-bot","wechat"],"created_at":"2024-08-02T09:01:09.332Z","updated_at":"2025-07-09T04:04:56.052Z","avatar_url":"https://github.com/wey-gu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Chatroom-Syncer\n\n[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm.fming.dev)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/chatroom-syncer.svg)](https://pypi.org/project/chatroom-syncer/)\n[![GitHub stars](https://img.shields.io/github/stars/wey-gu/chatroom-syncer.svg)](https://github.com/wey-gu/chatroom-syncer/stargazers)\n[![Code size](https://img.shields.io/github/languages/code-size/wey-gu/chatroom-syncer.svg)](https://github.com/wey-gu/chatroom-syncer)\n[![Actions Status](https://github.com/wey-gu/chatroom-syncer/workflows/Continuous%20Integration/badge.svg)](https://github.com/wey-gu/chatroom-syncer/actions)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\nChatroom-Syncer is a project to sync IM Chat Room to the public domain like IRC in the old days, so that the information, context and history of communication could be discoverred, learnt from and referenced by others, anyware, anytime.\n\n\u003e https://user-images.githubusercontent.com/1651790/207810877-b86943fa-24b3-479c-ac25-d602a6c5d53c.mp4\n\n**Supported Sinks**\n- [x] Slack\n- [x] GitHub\n- [ ] IRC\n- [ ] Telegram\n- [ ] Discord\n\n## Components and Flow\n\n| Components        | Docker Images       | Image Comments |\n| ----------------  | ------------------ | ------------- |\n| `wechaty-gateway` | [![Docker Image docker:wechaty-gateway](https://img.shields.io/docker/v/weygu/wechaty-gateway?label=Latest%20Tag)](https://hub.docker.com/r/weygu/wechaty-gateway) | `\"wechaty\": \"1.20.2\"` \u003cbr/\u003e `\"wechaty-puppet-wechat\": \"1.18.4\"` |\n| `chatroom-syncer` | [![Docker Image docker:chatroom-syncer](https://img.shields.io/docker/v/weygu/chatroom-syncer?label=Latest%20Tag)](https://hub.docker.com/r/weygu/chatroom-syncer) | - tag: `dev` is the main branch head\u003cbr/\u003e - `latest` is the latest release on [![PyPI](https://img.shields.io/pypi/v/chatroom-syncer.svg)](https://pypi.org/project/chatroom-syncer/) \u003cbr/\u003e |\n\n\nThere are two processes in the system:\n- Chatroom Syncer, current code base in Python as the WeChaty Client and the bot\n- WeChaty Gateway, which leverages the Wechaty with UOS Wechat Client(also named as a puppet) to be called by the Chatroom Syncer due to WebChaty is not a native Python library, and the Wechaty Gateway is a gRPC server to manipulate and watch WeChat the puppet.\n\nThus, we need to start the WeChaty Gateway before the Chatroom Syncer.\n\n```asciiarm\n┌────────────────────────────┐        ┌────────┐     ┌────────┐\n│                            │        │ Sink   │     │        │\n│ Chatroom Syncer            │        │        │     │        │\n│                            │        │ GitHub │     │        │\n│ onMessage()                ├────────▶ Slack ─ ─ ─ ─▶ Linen* │\n│   self.use(***SinkPlugin())│        │        │     │        │\n│                            │        │        │     │        │\n└──────────────▲─────────────┘        │        │     │        │\n               │                      └────────┘     └────────┘\n             gRPC\n               │\n┌──────────────▼──────────────┐\n│                             │\n│  Wechaty Gateway            │\n│                             │\n│                             │\n│┌────────────────────────┐   │\n││ Wechaty UOS puppet     │   │\n│└────────────────────────┘   │\n└─────────────────────────────┘\n\n# * Linen.dev is a Open Source project and a SaaS/Cloud service to help sync slack/discord to a searchable and shareable public domain.\n\n```\n\n## Run\n\nBefore running, we need follow prerequisites:\n\n- Configure WeChat Group Names and Sink Info in `config.yaml`, they should exist in both WeChat and Sink.\n- Configure Sink API token(Slack API Token, GitHub Token etc) in `.env`.\n\n### Run with Docker\n\nRun it in background:\n\n```bash\ncp config-example.yaml config.yaml\ncp env-example .env\ndocker-compose up -d\n```\n\nCheck both containers are Up:\n\n```bash\ndocker-compose ps\n```\n\nIn case there are any `Exit 0` containers, give another try of starting up:\n\n```bash\ndocker-compose up -d\n```\n\nScan the QR code with your WeChat App, and you are ready to go!\n\n```bash\ndocker logs chatroom-syncer_chatroom-syncer_1 2\u003e/dev/null | grep -v Wechaty\n```\n\nStop it:\n\n```bash\ndocker-compose down\n```\n\n### Run from host\n\nRun Webchaty gateway first:\n\n```bash\nexport token=\"iwonttellyou\"\ndocker run -d \\\n    --name=wechaty-gateway \\\n    --net=bridge \\\n    -p 9009:9009 \\\n    -e WECHATY_PUPPET_SERVICE_TOKEN=\"$token\" \\\n    --restart=unless-stopped weygu/wechaty-gateway:latest\n```\n\nRun Chatroom-Syncer:\n\n```bash\n# install it\npython3 -m pip install chatroom-syncer\n# create config.yaml and change it\ncp config-example.yaml config.yaml\n\n# put tokens for sink according to your config.yaml\n# i.e. if both slack and github discussion sinks were enabled\n# we need token to send message to slack and github discussion\n# as follow:\nexport SLACK_BOT_TOKEN=\"xoxb-1234567890-1234567890-1234567890-1234567890\"\nexport GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxx\n\n# run it\npython3 -m chatroom_syncer\n```\n\n## Configuration\n\n### WeChat\n\nCopy the config-example.yaml to config.yaml\n\n```bash\ncp config-example.yaml config.yaml\n```\n\nAnd fill in the following fields in the table:\n\n| Field | Description |\n| ----  | ----------- |\n| `enable_slack`                    | Switch of slack sink                                        |\n| `group_channel_mapping`           | Mapping WeChat group name to Slack channel name             |\n| `enable_avatar`                   | Switch to generate emoji-based avatar for Slack sink        |\n| `enable_github_discussion`        | Switch of Github Discussion sink                            |\n| `group_github_discussion_mapping` | Mapping WeChat group name to discussion:owner/repo/category |\n\n\n## Contribute\n\n### Build from host\n\n```bash\ngit clone https://github.com/wey-gu/chatroom-syncer \u0026\u0026 cd chatroom-syncer\n# install pdm\ncurl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -\n# install chatroom-syncer\npdm install\n```\n\nIf dependencies are updated, run `pdm sync` to update the lock manifest.\n\n```bash\npdm sync\n```\n\n### Build from docker\n\n```bash\ndocker-compose -f docker-compose.dev.yaml build\ndocker-compose -f docker-compose.dev.yaml up -d\n\n# get QR code to scan\ndocker logs chatroom-syncer_chatroom-syncer_1 2\u003e/dev/null | grep -v Wechaty\n\n# watch logs of the chatroom syncer\ndocker logs chatroom-syncer_chatroom-syncer_1 --follow\n\n# stop the chatroom syncer and remove the container\ndocker-compose -f docker-compose.dev.yaml down\n```\n\n### linting\n\n```bash\n# install pre-commit\npip install pre-commit\n\n# run pre-commit\npre-commit run --all-files\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwey-gu%2Fchatroom-syncer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwey-gu%2Fchatroom-syncer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwey-gu%2Fchatroom-syncer/lists"}