Skip to content

EldersJavas/EsDingTalkBot_Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EsDingTalkBot_Go

goreportcard Go Reference GitHub license GitHub stars GitHub go.mod Go version

Using DingTalk GroupBot with one line

So easy!

DingTalk Doc:https://developers.dingtalk.com/document/robots/custom-robot-access

Use

Text

image

//func Text(token string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error
dingbot.Text("123","hello",[]string{},[]string{},false)

Link

image

//func Link(token string, content string, Title string, PicUrl string, MessageUrl string) error
dingbot.Link("123","Hello World!","Hello","https://github.com/fluidicon.png","https://github.com/EldersJavas/EsDingTalkBot_Go")

MarkDown

image

//func MD(token string, title string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error
dingbot.MD("123","# Hello",[]string{},[]string{},false)

AActionCard

image

//func AActionCard(token string, Title string, content string, BtnOrientation string, SingleTitle string, SingleURL string) error
dingbot.AActionCard("123","hello","Hello World!","1","EsDingTalkBot_Go","https://github.com/EldersJavas/EsDingTalkBot_Go")

DActionCard

image

/*
func DActionCard(token, Title, content, BtnOrientation string, Btns []struct {
Title     string `json:"title"`
ActionURL string `json:"actionURL"`
}) error
*/
var Btn []struct {
  Title     string `json:"title"`
  ActionURL string `json:"actionURL"`}
var Add struct{
  Title     string `json:"title"`
  ActionURL string `json:"actionURL"`}
Add.Title="EsDingTalkBot_Go"
Add.ActionURL="https://github.com/EldersJavas/EsDingTalkBot_Go"
Btn = append(Btn, Add)
err := dingbot.DActionCard("123", "hello", "", "1", Btn)

FeedCard

image

/*
func func FeedCard(token string, Links []struct {
	Title      string `json:"title"`
	MessageURL string `json:"messageURL"`
	PicURL     string `json:"picURL"`
}) error
*/
var Links []struct{
  Title      string `json:"title"`
  MessageURL string `json:"messageURL"`
  PicURL     string `json:"picURL"`}
var Add struct{
  Title      string `json:"title"`
  MessageURL string `json:"messageURL"`
  PicURL     string `json:"picURL"`}
Add.Title="EsDingTalkBot_Go"
Add.PicURL="https://github.com/fluidicon.png"
Add.MessageURL="https://github.com/EldersJavas/EsDingTalkBot_Go"
Links = append(Links, Add)
err := dingbot.FeedCard("123", Links)

Error Back

err := FeedCard("123", Links)
if err != nil {
  return
}