dingtalk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeText       = "text"
	MsgTypeLink       = "link"
	MsgTypeMarkdown   = "markdown"
	MsgTypeActionCard = "actionCard"
	MsgTypeFeedCard   = "feedCard"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BTns

type BTns struct {
	Title     string `json:"title"`
	ActionURL string `json:"actionUrl"`
}
type FeedCardLink struct {
	Title      string `json:"title"`
	MessageURL string `json:"messageUrl"`
	PicURL     string `json:"picUrl,omitempty"`
}

type Robot

type Robot struct {
	Token  string
	SecKey string
}

Robot 表示可以将消息发送到组的dingtalk自定义机器人

func (Robot) SendActionCard

func (r Robot) SendActionCard(title, text, singleTitle, singleURL, btnOrientation string, bTns []BTns) error

SendActionCard 发送action card类型消息。

func (Robot) SendFeedCard

func (r Robot) SendFeedCard(links []FeedCardLink) error

SendFeedCard 发送feed card类型消息.

func (r Robot) SendLink(title, text, messageURL, picURL string) error

SendLink 发送link类型消息。

func (Robot) SendMarkdown

func (r Robot) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) error

SendMarkdown 发送markdown类型消息。

func (Robot) SendText

func (r Robot) SendText(content string, atMobiles []string, isAtAll bool) error

SendText 发送text类型的消息。

type Roboter

type Roboter interface {
	SendText(content string, atMobiles []string, isAtAll bool) error
	SendLink(title, text, messageURL, picURL string) error
	SendMarkdown(title, text string, atMobiles []string, isAtAll bool) error
	SendActionCard(title, text, singleTitle, singleURL, btnOrientation string, bTns []BTns) error
	SendFeedCard(links []FeedCardLink) error
}

Roboter 是由Robot实现的接口,可以发送多种类型的消息。

func NewRobot

func NewRobot(token, secKey string) Roboter

NewRobot 返回可以发送消息的Roboter

Jump to

Keyboard shortcuts

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