Skip to content

Commit

Permalink
Merge branch 'dev' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
danni-cool committed Oct 11, 2023
2 parents a8ff260 + 4f4af46 commit 4dcbd64
Show file tree
Hide file tree
Showing 10 changed files with 565 additions and 1,905 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/docker-build.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release and Push Docker Hub

on:
push:
branches:
- main

jobs:
build:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: docker-wechatbot-webhook
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Refactor","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]'

- name: Checkout Repository
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: dannicool
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
run: |
docker build . -t dannicool/docker-wechatbot-webhook:latest
docker push dannicool/docker-wechatbot-webhook:latest
35 changes: 0 additions & 35 deletions .versionrc.js

This file was deleted.

15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@

## [1.4.1](https://github.com/danni-cool/docker-wechatbot-webhook/compare/v1.4.0...v1.4.1) (2023-10-10)
## [1.5.0](https://github.com/danni-cool/docker-wechatbot-webhook/compare/v1.4.0...v1.5.0) (2023-10-11)


### Features

* 🎸 增加 /login api,并作为默认推荐登录api & 代码和文案优化 ([b3012e4](https://github.com/danni-cool/docker-wechatbot-webhook/commit/b3012e41bacf6369f4d6b017a8126919d199801d))


### Bug Fixes

* 🐛 login api redirect 301 改为 302,解决二维码失效问题 ([c9b6708](https://github.com/danni-cool/docker-wechatbot-webhook/commit/c9b670864dcc8c8b31b7116c722ed50f69fe2b81))


### Performance Improvements

* ⚡️ 不再需要两套登录api,合二为一 ([9968d66](https://github.com/danni-cool/docker-wechatbot-webhook/commit/9968d6689cbb4d68a7dbb08eda74a2b954e22455))

# [1.4.0](https://github.com/danni-cool/docker-wechatbot-webhook/compare/v1.3.0...v1.4.0) (2023-10-09)

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div style="text-align:center">
<div align="center">
<img src="https://cdn.jsdelivr.net/gh/danni-cool/danni-cool@cdn/image/wechatbot-webhook.png" width="500" height="251"/>


![Docker Image Version (latest semver)](https://img.shields.io/docker/v/dannicool/docker-wechatbot-webhook) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/danni-cool/docker-wechatbot-webhook/release.yml) ![Docker Pulls](https://img.shields.io/docker/pulls/dannicool/docker-wechatbot-webhook)

4 步即可完成从 http 请求到推送微信消息,快用它集成到自己的自动化工作流中吧
使用 http 请求即可给微信发消息,简化了使用 [Wechaty](https://github.com/wechaty/wechaty) 的过程,快用它集成到自己的自动化工作流中吧

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

Expand Down Expand Up @@ -121,7 +121,7 @@ curl --location --request POST 'http://localhost:3001/webhook/msg' \

### 2. 收消息

> 收消息接口使用 `form` 传递参数,因为要兼容有文件的情况,文件目前也只兼容了**图片**
> 收消息接口使用 form 表单传递参数
入参:

Expand All @@ -131,10 +131,10 @@ curl --location --request POST 'http://localhost:3001/webhook/msg' \

| formData | 说明 | 数据类型 | 可选值 | 示例 |
|--|--|--|--|-- |
| type | 表单类型 | `String` | `text` / `img` | |
| content | 传输的内容,文件也放在这个字段,如果是图片收到的就是二进制buffer, 如果 `isSystemEvent` 为 '1', 将收到 JSON String | `String` / `Binary` | | [示例](docs/recvdApi.example.md#formdatacontent) |
| type | <div>支持的类型</div><ul><li>✅ 文字(text)</li><li>✅ 图片(file)</li><li>✅ 视频(file)</li><li>✅ 附件(file)</li> <li>✅ 语音(file)</li></ul> 不支持的类型<ul><li>❌ 自定义表情</li><li>❌ 视频号</li><li>❌ 小程序</li></ul> refer: [wechaty类型支持列表](https://wechaty.js.org/docs/api/message#messagetype--messagetype) | `String` | `text` `file` `urlLink` | - |
| content | 传输的内容, 文本或传输的文件共用这个字段,结构映射请看示例 | `String` `Binary` | | [示例](docs/recvdApi.example.md#formdatacontent) |
| source | 消息的相关发送方数据, JSON String | `String` | | [示例](docs/recvdApi.example.md#formdatasource) |
| isSystemEvent | 是否是来自系统消息事件(比如上线,掉线、异常事件)| `String` | `1` `0` | |
| isSystemEvent | 是否是来自系统消息事件(比如上线,掉线、异常事件)| `String` | `1` `0` | - |

### 3. 登录APi

Expand Down
36 changes: 32 additions & 4 deletions docs/recvdApi.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@

## formData.content `String` | `Binary`

特殊结构说明:
`formData.isSystemEvent` === '1' 时,`formData.content` 为以下结构 json string
`formData` 内的字段和 `formData.content` 映射如下:

### login/logout/error 事件
<table>
<thead>
<tr><th>字段条件</th> <th>字段类型说明</th> <th>formData.content 数据结构</th></tr>
</thead>
<tbody>
<tr><td><code>formData.isSystemEvent</code> === '1'</td><td> <code>json string</code></td><td>

```js
{
"event": "login", // login | logout | error

"user": { // 当前的用户信息
"user": { // 当前的用户信息,没有则为null
"_events": {},
"_eventsCount": 0,
"id": "@xxxasdfsf",
Expand All @@ -33,6 +37,30 @@
}
```

</td></tr>
<tr>
<td><code>formData.type</code> === 'urlLink'</td>
<td>
<code>json string</code>
</td>
<td>

```js
{
description: "AI技术逐渐成为设计师的灵感库",
thumbnailUrl: "",
title: "AI神器帮助你从小白秒变设计师",
url: "http://example.url",
}
```

</td>
</tr>
</tbody>
</table>

### 时,返回 json string 如下

## formData.source `String`

```js
Expand Down
Loading

0 comments on commit 4dcbd64

Please sign in to comment.