Documentation ¶
Index ¶
- Constants
- func CmdSend(arg *CmdSendParams) error
- func Send(accessToken string, msg *Message) error
- func ValidateMsgType(v string) error
- type CardElement
- type CardElementAction
- type CardElementActionText
- type CardElementText
- type CardHeader
- type CardHeaderTitle
- type CardMeta
- type CmdSendParams
- type ContentMeta
- type Message
- type PostMeta
- type PostZhCn
- type PostZhCnContent
Constants ¶
View Source
const ( MsgTypeText = "text" // 文本 MsgTypePost = "post" // 富文本 MsgTypeImage = "image" // 图片 MsgTypeInteractive = "interactive" // 消息卡片 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CardElement ¶
type CardElement struct { Tag string `json:"tag"` Text CardElementText `json:"text,omitempty"` Actions []CardElementAction `json:"actions,omitempty"` }
type CardElementAction ¶
type CardElementAction struct { Tag string `json:"tag"` Text CardElementActionText `json:"text"` Url string `json:"url"` Type string `json:"type"` Value struct { } `json:"value"` }
type CardElementActionText ¶
type CardElementText ¶
type CardHeader ¶
type CardHeader struct {
Title CardHeaderTitle `json:"title"`
}
type CardHeaderTitle ¶
type CardMeta ¶
type CardMeta struct { Elements []CardElement `json:"elements"` Header CardHeader `json:"header"` }
CardMeta 消息卡片
type CmdSendParams ¶
type CmdSendParams struct { UserAgent string AccessToken string Secret string MsgType string Data string }
func (*CmdSendParams) Validate ¶
func (t *CmdSendParams) Validate() error
type ContentMeta ¶
type Message ¶
type Message struct { MsgType string `json:"msg_type"` // 消息类型 TimeStamp string `json:"timestamp,omitempty"` // 为距当前时间不超过 1 小时(3600)的时间戳,时间单位s Sign string `json:"sign,omitempty"` // 签名 Content *ContentMeta `json:"content,omitempty"` // 消息内容 Card *CardMeta `json:"card,omitempty"` // 消息卡片 }
Message 飞书自定义机器人消息
type PostZhCn ¶
type PostZhCn struct { Title string `json:"title"` Content [][]PostZhCnContent `json:"content"` }
type PostZhCnContent ¶
type PostZhCnContent struct { Tag string `json:"tag"` Text string `json:"text,omitempty"` Href string `json:"href,omitempty"` UserId string `json:"user_id,omitempty"` UserName string `json:"user_name,omitempty"` ImageKey string `json:"image_key,omitempty"` FileKey string `json:"file_key,omitempty"` EmojiType string `json:"emoji_type,omitempty"` }
Click to show internal directories.
Click to hide internal directories.