dingbot

package module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

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)

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
}

Documentation

Index

Constants

View Source
const URL = "https://oapi.dingtalk.com/robot/send?access_token="

Variables

This section is empty.

Functions

func AActionCard

func AActionCard(token string, Title string, content string, BtnOrientation string, SingleTitle string, SingleURL string) error

AActionCard 推送 整体跳转ActionCard

func DActionCard

func DActionCard(token, Title, content, BtnOrientation string, Btns []struct {
	Title     string `json:"title"`
	ActionURL string `json:"actionURL"`
}) error

DActionCard 推送 独立跳转ActionCard

func FeedCard

func FeedCard(token string, Links []struct {
	Title      string `json:"title"`
	MessageURL string `json:"messageURL"`
	PicURL     string `json:"picURL"`
}) error

FeedCard 推送FeedCard

func Link(token string, content string, Title string, PicUrl string, MessageUrl string) error

func MD

func MD(token string, title string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error

MD 推送Markdown

func Text

func Text(token string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error

Text 推送文本

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL