address
Install
go get github.com/go-packagist/youdu
use
package main
import (
"github.com/go-packagist/youdu"
"github.com/go-packagist/youdu/message"
"log"
)
func main() {
yd := youdu.New(&youdu.Config{
Api: "http://domain.com/api",
Buin: 1111111,
AppId: "22222222222222",
AesKey: "3444444444444444444444444444444444",
})
yd.Message().SendText("11111", "test")
yd.Message().Send(&message.TextMessage{
ToUser: "11111",
ToDept: "",
MsgType: message.MsgTypeText,
Text: &message.TextItem{
Content: "test",
},
})
mediaId, err := yd.Media().Upload(youdu.MediaTypeImage, "test.jpeg")
if err != nil {
panic(err)
}
yd.Message().Send(&message.ImageMessage{
ToUser: "11111",
ToDept: "",
MsgType: message.MsgTypeImage,
Image: &message.MediaItem{
MediaId: mediaId,
},
})
}
References
- Youdu API official documentation: youdu.im/doc/api/c01_00001.html
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。