Skip to content

clem109/go-wechat-work

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Go Report Card License GoDoc

WeChat Work

Use the WeChat work API in your Golang apps to send notifications

API reference for WeChat Work, please check this to know how to configure the settings below.

go get github.com/clem109/go-wechat-work

Usage

In the below example we include TextCard, Text and News however only the News will be sent as the MsgType is set to "news".

package main

import ("github.com/clem109/go-wechat-work")

func main() {
	wechat := WeChatWork{
		Config: Config{
			CorpID:     "corpid",
			CorpSecret: "somesecret",
			SkipVerify: true,
			Debug:      false,
			Notification: Notification{
				Agentid: 123456,
				MsgType: "news",
				ToUser:  "@all",
				ToParty: "@all",
				ToTag:   "@all",
				Safe:    0,
				TextCard: TextCard{
					Title:       "test",
					Description: "testing",
					MsgURL:      "someurl;",
					BtnTxt:      "p",
				},
				Text: Text{
					Content: "text message test",
				},
				News: News{
					Articles: []Article{
						Article{
							Title:       "Testing News",
							Description: "Star my repo ;)",
							URL:         "https://github.com/clem109/go-wechat-work",
							PicURL:      "https://raw.githubusercontent.com/clem109/glowing-gopher/master/gopher.jpeg",
						},
					},
				},
			},
		},
	}

	wechat.Exec()
}

About

🎉 WeChat work notifications in GoLang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages