Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guohuiyuan/wxworkwebhook

尝试写一下wxwork的webhook的api的包装
https://github.com/guohuiyuan/wxworkwebhook

webhook wework

Last synced: about 2 months ago
JSON representation

尝试写一下wxwork的webhook的api的包装

Awesome Lists containing this project

README

        

# WxworkWebhook

企业微信webhook的api的封装,支持file,image,text,news,file消息类型,template_card类型稍复杂,暂时不支持

发送图片和文件需要本地路径,要自行下载网络上的文件,不处理下载逻辑

```
package main

import (
"fmt"

wxworkwebhook "github.com/guohuiyuan/WxworkWebhook"
)

func main() {
w := wxworkwebhook.NewWebhook("693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa")
fmt.Println(w.SendFile("example/黒金.jpg"))
fmt.Println(w.SendImage("example/黒金.jpg"))
fmt.Println(w.SendImage("http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"))
fmt.Println(w.SendText("大家要好好吃饭"))
fmt.Println(w.SendMarkdown("# 大家要好好吃饭"))
fmt.Println(w.SendNews("晚上好", "大家要好好吃饭", "https://b23.tv/BV1bz4y1z7uu", "http://i2.hdslb.com/bfs/archive/d04b95ba3658a39f594fc60379eaf84385126a81.png"))
}

```