dingtalk

package
v0.0.0-...-21b6829 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BtnOrientationHorizonal 横排
	BtnOrientationHorizonal = 0
	// BtnOrientationVertical 横排
	BtnOrientationVertical = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCardButton

type ActionCardButton struct {
	Title     string
	ActionURL string
}

ActionCardButton ActionCard的按钮内容

type BtnOrientation

type BtnOrientation int

BtnOrientation 按钮排列类型

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 钉钉消息推送机器人客户端

func NewClient

func NewClient(token, secret string) *Client

NewClient create a client

func (*Client) SendActionCardMsg

func (c *Client) SendActionCardMsg(title, text string, hideAvatar bool, btnOrientation BtnOrientation, buttons ...ActionCardButton) error

SendActionCardMsg 发送 独立跳转ActionCard类型 消息 title: 首屏会话透出的展示内容 text: markdown格式的消息 hideAvatar: 是否隐藏头像 btnOrientation: BtnOrientationHorizonal:按钮竖直排列

BtnOrientationVertical:按钮横向排列

buttons: 按钮

func (*Client) SendFeedCardMsg

func (c *Client) SendFeedCardMsg(feedCards []FeedCard) error

SendFeedCardMsg 发送 FeedCard类型 消息 title: 首屏会话透出的展示内容 text: markdown格式的消息 hideAvatar: 是否隐藏头像 btnOrientation: BtnOrientationHorizonal:按钮竖直排列

BtnOrientationVertical:按钮横向排列

buttons: 按钮

func (*Client) SendLinkMsg

func (c *Client) SendLinkMsg(title, text, messageURL, picURL string, atAll bool, mobiles ...string) error

SendLinkMsg 发送 link类型 消息 title: 消息标题 text: 消息内容,如果太长只会部分展示 messageURL: 点击消息跳转的URL picURL: 图片URL atAll: 是否@所有人 mobiles: 被@人的手机号

func (*Client) SendMarkdownMsg

func (c *Client) SendMarkdownMsg(title, text string, atAll bool, mobiles ...string) error

SendMarkdownMsg 发送 markdown类型 消息 title: 首屏会话透出的展示内容 text: markdown格式的消息 atAll: 是否@所有人 mobiles: 被@人的手机号

func (*Client) SendSingleActionCardMsg

func (c *Client) SendSingleActionCardMsg(title, text, singleTitle, singleURL string, btnOrientation BtnOrientation) error

SendSingleActionCardMsg 发送 整体跳转ActionCard类型 消息 title: 首屏会话透出的展示内容 text: markdown格式的消息 singleTitle: 单个按钮的标题 singleURL: 点击singleTitle按钮触发的URL btnOrientation: BtnOrientationHorizonal:按钮竖直排列

BtnOrientationVertical:按钮横向排列

func (*Client) SendTextMsg

func (c *Client) SendTextMsg(text string, atAll bool, mobiles ...string) error

SendTextMsg 发送 link类型 消息 text: 消息内容,如果太长只会部分展示 atAll: 是否@所有人 mobiles: 被@人的手机号

type FeedCard

type FeedCard struct {
	Title      string //单条信息文本
	MessageURL string //点击单条信息到跳转链接
	PicURL     string //单条信息后面图片的URL
}

FeedCard FeedCard的内容

Jump to

Keyboard shortcuts

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