Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Revert "[skip ci]: change cdn address"
Browse files Browse the repository at this point in the history
This reverts commit 8c45cef.
  • Loading branch information
chentianyu committed Sep 28, 2023
1 parent 8c45cef commit 0b0ec7a
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PORT=3001
# 如果想自己处理收到消息的逻辑,在下面填上你的webhook地址, 默认为空
RECVD_MSG_WEBHOOK=https://home.danielcoding.me:888/webhook-test/53f51927-9cec-447b-899a-d4a212000808
RECVD_MSG_WEBHOOK=
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

[view this project on docker hub :)](https://hub.docker.com/repository/docker/dannicool/docker-wechatbot-webhook/general)

## 一、启动
## 一、开始

### 1. 本地调试

```
npm start
```

### 2. docker 部署
### 2. docker 启动

#### 拉取镜像

Expand All @@ -26,13 +26,10 @@ docker pull dannicool/docker-wechatbot-webhook

#### 启动容器(后台常驻)

> -e RECVD_MSG_WEBHOOK 环境变量可以不填,如果你还想收消息, 可以传入
```bash
docker run -d \
--name wcRoomBot \
-p 3001:3001 \
-e RECVD_MSG_WEBHOOK="https://example.com/your/url" \
dannicool/docker-wechatbot-webhook
```

Expand All @@ -44,11 +41,13 @@ docker logs -f wcRoomBot

找到二维码登录地址,图下 url 部分,浏览器访问,扫码登录wx

![](https://cdn.jsdelivr.net/gh/danni-cool/danni-cool@cdn/image/docker-login-wechat.png)
![](https://cdn.jsdelivr.net/gh/danni-cool/blog.danni.cool/cdn/image/docker-login-wechat.png)

## 二、给机器人推送消息

## 二、webhook
目前只支持 **文字****图片**,消息不支持图文自动拆分,请手动调多次

### 1. 推消息
### webhook格式

- Url:<http://localhost:3001/webhook/msg>
- Methods: `POST`
Expand All @@ -61,12 +60,14 @@ docker logs -f wcRoomBot
|--|--|--|--|--|--|--|
| to | 会话名 | String | | N | | 发群消息填群名,发给个人填昵称 |
| isRoom | 是否发的群消息 | Boolean | false | Y | <ul><li>true</li><li>false</li></ul> | |
| type | 发送消息类型 | String || N | <ul><li>text</li><li>img</li></ul> | 目前只支持 **文字****图片**,消息不支持图文自动拆分,请手动调多次 |
| type | 发送消息类型 | String || N | <ul><li>text</li><li>img</li></ul> | |
| content | 发送的消息 | String | | N | | 如果希望发多张图,type 指定为 img 同时,content 里填 url 以英文逗号分隔 |

### 2. 收消息
<!-- ## 三、机器人收到消息
格式
> 目前收到消息也是使用webhook,逻辑单独放到外部流程去处理,如果觉得麻烦,想自己定制,欢迎 folk
### 1. 配置收消息 webhook
#### 本地调试
Expand All @@ -78,7 +79,11 @@ PORT=3001
RECVD_MSG_WEBHOOK=https://xxxx.com/web-hook/roomBot-msg-received
```
### 2. 在群里 `@微信名` + 要说的话
## 四、更新日志
-->

## 三、更新日志

更新内容参见 [CHANGELOG](https://github.com/danni-cool/docker-wechat-roomBot/blob/main/CHANGELOG.md)
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN npm install
COPY . .

# 如果收消息想接入webhook
ENV RECVD_MSG_WEBHOOK=
# ENV RECVD_MSG_WEBHOOK=

# 暴露端口(你的 Express 应用程序监听的端口)
EXPOSE 3001
Expand Down
Loading

0 comments on commit 0b0ec7a

Please sign in to comment.