dingtalk

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCard

type ActionCard struct {
	Title          string `json:"title"`                 // [必填] 首屏会话透出的展示内容
	Text           string `json:"text"`                  // [必填] markdown格式的消息
	SingleTitle    string `json:"singleTitle,omitempty"` // [必填] 单个按钮的标题
	SingleURL      string `json:"singleURL,omitempty"`   // [必填] 点击消息跳转的URL
	BtnOrientation string `json:"btnOrientation"`        // 0:按钮竖直排列 1:按钮横向排列
	Btns           []Btn  `json:"btns,omitempty"`        // 独立跳转ActionCard类型使用
}

ActionCard actionCard类型

type At

type At struct {
	AtMobiles []string `json:"atMobiles"`
	AtUserIds []string `json:"atUserIds"`
	IsAtAll   bool     `json:"isAtAll"`
}

At 被@的人

type Btn

type Btn struct {
	Title     string `json:"title"`     // 按钮标题
	ActionURL string `json:"actionURL"` // 点击按钮触发的URL
}

Btn 独立跳转actionCard类型中的按钮

type FeedCard

type FeedCard struct {
	Links []FeedCardLink `json:"links"`
}

FeedCard feedCard类型

type FeedCardLink struct {
	Title      string `json:"title"`      // [必填] 单条信息文本
	MessageURL string `json:"messageURL"` // [必填] 点击单条信息到跳转链接。
	PicURL     string `json:"picURL"`     // [必填] 单条信息后面图片的URL
}
type Link struct {
	Title      string `json:"title"`      // [必填] 消息标题
	Text       string `json:"text"`       // [必填] 消息内容。如果太长只会部分展示
	MessageURL string `json:"messageUrl"` // [必填] 点击消息跳转的URL
	PicURL     string `json:"picUrl"`     // 图片URL
}

Link link类型

type Markdown

type Markdown struct {
	Title string `json:"title"` // [必填] 首屏会话透出的展示内容
	Text  string `json:"text"`  // [必填] markdown格式的消息
}

Markdown markdown类型

type Message

type Message struct {
	MsgType    string     `json:"msgtype"`              // 消息类型
	Text       Text       `json:"text,omitempty"`       // text类型
	Link       Link       `json:"link,omitempty"`       // link类型
	Markdown   Markdown   `json:"markdown,omitempty"`   // markdown类型
	ActionCard ActionCard `json:"actionCard,omitempty"` // actionCard类型
	FeedCard   FeedCard   `json:"feedCard,omitempty"`   // feedCard类型
	At         At         `json:"at,omitempty"`
	WebhookURL string     `json:"-"` // 钉钉群的webhook地址
}

Message https://open.dingtalk.com/document/orgapp/custom-robot-access#title-72m-8ag-pqw

func (Message) SendDingTalk

func (msg Message) SendDingTalk() error

SendDingTalk 发送消息到钉钉群

type Text

type Text struct {
	Content string `json:"content"` // 消息内容
}

Text text类型

Jump to

Keyboard shortcuts

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