From b20d74f335d88d26a55f0c264a6b7ed622301ffc Mon Sep 17 00:00:00 2001 From: Araceae Date: Sat, 26 Jun 2021 21:27:02 +0800 Subject: [PATCH] docs: add docs for service wechat official account --- docs/contribution.md | 1 + docs/home.md | 1 + docs/services.md | 55 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/docs/contribution.md b/docs/contribution.md index 306442a..1e7c80c 100644 --- a/docs/contribution.md +++ b/docs/contribution.md @@ -14,6 +14,7 @@ possible. - `service/telegram` - Telegram notification service. - `service/pushover` - Pushover Notification service. - `service/line` - Line notification service. + - `service/wechat` - Wechat Official Account notification service. ### Documentation diff --git a/docs/home.md b/docs/home.md index c39edd5..5b7da96 100644 --- a/docs/home.md +++ b/docs/home.md @@ -59,6 +59,7 @@ platforms. - *Telegram* - *Twillio* - *Line Messenger* +- *Wechat Official Account* ## Demo diff --git a/docs/services.md b/docs/services.md index d048915..b6761c3 100644 --- a/docs/services.md +++ b/docs/services.md @@ -643,3 +643,58 @@ pingme email \ | EMAIL_PORT | "587" | | EMAIL_MESSAGE | "" | | EMAIL_SUBJECT | "" | + + +## Wechat Official Account + +Wechat uses appid, appsecret, chatbot server token and encoding AES key for authentication, and sends messages. + +```bash +pingme wechat +--appid "xxxxxxxx" \ +--appsecret 'xxxxxxxxxx' \ +--token 'xxxxxxxxxx' \ +--aes 'IGNORED-IN-SANDBOX' \ +--msg 'content of message' \ +--receivers 'some receivers' +``` + +- GitHub Action + +```yaml +on: [push] + +jobs: + pingme-job: + runs-on: ubuntu-latest + name: PingMe + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Ping me On + uses: kha7iq/pingme-action@v1 + env: + WECHAT_APPID: ${{ secrets.WECHAT_APPID }} + WECHAT_APPSECRET: ${{ secrets.WECHAT_APPSECRET }} + WECHAT_TOKEN: ${{ secrets.WECHAT_TOKEN }} + WECHAT_ENCODINGAESKEY: ${{ secrets.WECHAT_ENCODINGAESKEY }} + WECHAT_RECEIVER_IDS: ${{ secrets.WECHAT_RECEIVER_IDS }} + WECHAT_MSG_TITLE: 'Reference: ${{ github.ref }}' + WECHAT_MESSAGE: 'Event is triggered by ${{ github.event_name }}' + + with: + service: wechat +``` + +- **Variables** + +| Variables | Default Value | +| -------------------------- | :----------------: | +| WECHAT_APPID | "" | +| WECHAT_APPSECRET | "" | +| WECHAT_TOKEN | "" | +| WECHAT_ENCODINGAESKEY | "" | +| WECHAT_RECEIVER_IDS | "" | +| WECHAT_MSG_TITLE | "" | +| WECHAT_MESSAGE | "" |