DCNews
This tool can instantly capture chat messages in WeChat groups and automatically synchronize them to the preset Discord channel
Implementation process: After receiving a new group message, query the corresponding table entry in the database, obtain which DC channel the message is synchronized to, and send the message. Therefore, you need to configure the config.json file, including the DC robot key and database connection method, and import the table structure. , configure the table, and the program can start synchronization
Configure the docker-config.json file, modify the database password, and add the Discord robot authorization token, corresponding to the docker-compose.yaml file below
{
"Discord_bot_auth" : "" ,
"Static_path" : "/app/static/" ,
"Mysql_host" :" 192.168 .210 . 11 ",
"Mysql_port" :" 3306 ",
"Mysql_db" :" dcnews ",
"Mysql_user" :" root ",
"Mysql_password" :" root ",
"Dc_createsync_prompts" : "正在建立微信与Dc同步渠道... n Step 1.请添加微信: n Step 2.将该微信拉入目标微信群,等待30秒n Step 3.在目标微信群输入同步码: "
}
Modify the database mapping port and password in docker-compose.yaml
mysql:
image: mysql: 5.7
networks:
dcnews_network:
ipv4_address:
192.168 . 210.11
ports:
- "23306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dcnews
Start docker compose
docker compose up
Find the WeChat login link in the log
Manually connect to the database, associate the corresponding channel of the group, and start synchronization.
create_time 添加时间
dc_user dc用户名称
wx_user 微信用户名称
wx_group 微信群组名称 必填
dc_channel_id dc频道ID 必填
dc_channel_info dc频道介绍 必填,需为URL
remark 备注
Download dependency packages:
go mod download
Configuration file
// 打开 config.json 配置 Discord 机器人key,静态文件存放路径,数据库连接方式
{
"Discord_bot_auth" : "" ,
"Static_path" : "" ,
"Mysql_host" :"",
"Mysql_port" :"",
"Mysql_db" :"",
"Mysql_user" :"",
"Mysql_password" :"",
"Dc_createsync_prompts" : "正在建立微信与Dc同步渠道... n Step 1.请添加微信 n Step 2.将该微信拉入目标微信群,等待30秒n Step 3.在目标微信群输入同步码: "
}
Import table structure
mysql -u -p
source dc_wx_association_table.sql
Build the project:
go build
Run the project:
chmod 744 ./dcnews
./dcnews
Project log:
logfile.log
Corresponding channel through database association group
create_time 添加时间
dc_user dc用户名称
wx_user 微信用户名称
wx_group 微信群组名称 必填
dc_channel_id dc频道ID 必填
dc_channel_info dc频道介绍 必填,需为URL
remark 备注