Documentation ¶
Index ¶
- type ActionCard
- type ActionCardButton
- type ActionCardMessage
- func (m *ActionCardMessage) AddBtn(btn *ActionCardButton) *ActionCardMessage
- func (m *ActionCardMessage) AddBtns(btn ...*ActionCardButton) *ActionCardMessage
- func (m *ActionCardMessage) SetBtns(btns []*ActionCardButton) *ActionCardMessage
- func (m *ActionCardMessage) ToMessageMap() map[string]interface{}
- type At
- func (m *At) AddAtMobiles(atMobiles ...string) *At
- func (m *At) AddAtUserIds(atUserIds ...string) *At
- func (m *At) AtAll() *At
- func (m *At) SetAtMobiles(atMobiles []string) *At
- func (m *At) SetAtUserIds(atUserIds []string) *At
- func (m *At) SetIsAtAll(isAtAll bool) *At
- func (m *At) ToAtMap() map[string]interface{}
- type BaseMessage
- type BtnOrientationType
- type Client
- type ErrorResponse
- type FeedCardMessage
- type Link
- type LinkMessage
- func (m *LinkMessage) SetMessageUrl(messageUrl string) *LinkMessage
- func (m *LinkMessage) SetPicUrl(picUrl string) *LinkMessage
- func (m *LinkMessage) SetText(text string) *LinkMessage
- func (m *LinkMessage) SetTitle(title string) *LinkMessage
- func (m *LinkMessage) ToMessageMap() map[string]interface{}
- type MarkdownMessage
- type Message
- type MsgType
- type SingleActionCardMessage
- type TextMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionCard ¶
type ActionCard struct { // Title 首屏会话透出的展示内容 Title string // Text markdown格式的消息 Text string // BtnOrientation btn 排列方式 BtnOrientation BtnOrientationType }
ActionCard 卡片
func (*ActionCard) SetBtnOrientation ¶
func (m *ActionCard) SetBtnOrientation(btnOrientation BtnOrientationType) *ActionCard
SetBtnOrientation set ActionCard.BtnOrientation
func (*ActionCard) SetText ¶
func (m *ActionCard) SetText(text string) *ActionCard
SetText set ActionCard.Text
func (*ActionCard) SetTitle ¶
func (m *ActionCard) SetTitle(title string) *ActionCard
SetTitle set ActionCard.Title
type ActionCardButton ¶
type ActionCardButton struct { // Title 按钮标题 Title string // ActionUrl 点击按钮触发的URL ActionUrl string }
ActionCardButton 跳转卡片中的按钮实体类
func NewActionCardButton ¶
func NewActionCardButton() *ActionCardButton
NewActionCardButton create ActionCardButton
func (*ActionCardButton) SetActionUrl ¶
func (m *ActionCardButton) SetActionUrl(actionUrl string) *ActionCardButton
SetActionUrl set ActionCardButton.ActionUrl
func (*ActionCardButton) SetTitle ¶
func (m *ActionCardButton) SetTitle(title string) *ActionCardButton
SetTitle set ActionCardButton.Title
type ActionCardMessage ¶
type ActionCardMessage struct { BaseMessage ActionCard Btns []*ActionCardButton }
ActionCardMessage 独立跳转ActionCard类型
func NewActionCardMessage ¶
func NewActionCardMessage() *ActionCardMessage
NewActionCardMessage crate ActionCardMessage
func (*ActionCardMessage) AddBtn ¶
func (m *ActionCardMessage) AddBtn(btn *ActionCardButton) *ActionCardMessage
AddBtn add ActionCardMessage.Btns
func (*ActionCardMessage) AddBtns ¶
func (m *ActionCardMessage) AddBtns(btn ...*ActionCardButton) *ActionCardMessage
AddBtns add ActionCardMessage.Btns
func (*ActionCardMessage) SetBtns ¶
func (m *ActionCardMessage) SetBtns(btns []*ActionCardButton) *ActionCardMessage
SetBtns set ActionCardMessage.Btns
func (*ActionCardMessage) ToMessageMap ¶
func (m *ActionCardMessage) ToMessageMap() map[string]interface{}
type At ¶
type At struct { // AtMobiles 被@人的手机号 AtMobiles []string // AtUserIds 被@人的用户userid AtUserIds []string // IsAtAll 是否@所有人 IsAtAll bool }
At @
func (*At) AddAtMobiles ¶
AddAtMobiles add At.AtMobiles
func (*At) AddAtUserIds ¶
AddAtUserIds add At.AtUserIds
func (*At) SetAtMobiles ¶
SetAtMobiles set At.AtMobiles
func (*At) SetAtUserIds ¶
SetAtUserIds set At.AtUserIds
type BaseMessage ¶
type BaseMessage struct {
MsgType MsgType
}
func (*BaseMessage) ToMsgTypeMap ¶
func (m *BaseMessage) ToMsgTypeMap() map[string]interface{}
type BtnOrientationType ¶
type BtnOrientationType string
const ( // Longitudinal 按钮竖直排列 Longitudinal BtnOrientationType = "0" // Transverse 按钮横向排列 Transverse BtnOrientationType = "1" )
type ErrorResponse ¶
ErrorResponse response error msg
type FeedCardMessage ¶
type FeedCardMessage struct { BaseMessage // Links 跳转链接 Links []*Link }
FeedCardMessage FeedCard类型
func NewFeedCardMessage ¶
func NewFeedCardMessage() *FeedCardMessage
NewFeedCardMessage create FeedCardMessage
func (*FeedCardMessage) AddLinks ¶
func (m *FeedCardMessage) AddLinks(links ...*Link) *FeedCardMessage
AddLinks add FeedCardMessage.Links
func (*FeedCardMessage) SetLinks ¶
func (m *FeedCardMessage) SetLinks(links []*Link) *FeedCardMessage
SetLinks set FeedCardMessage.Links
func (*FeedCardMessage) ToMessageMap ¶
func (m *FeedCardMessage) ToMessageMap() map[string]interface{}
type Link ¶
type Link struct { // Title 消息标题 Title string // PicUrl 图片URL PicUrl string // MessageUrl 点击消息跳转的URL MessageUrl string }
Link link
func (*Link) SetMessageUrl ¶
SetMessageUrl set Link.MessageUrl
type LinkMessage ¶
type LinkMessage struct { BaseMessage // Text 消息内容。如果太长只会部分展示 Text string Link }
LinkMessage 链接消息类型
func (*LinkMessage) SetMessageUrl ¶
func (m *LinkMessage) SetMessageUrl(messageUrl string) *LinkMessage
SetMessageUrl set LinkMessage#Link.MessageUrl
func (*LinkMessage) SetPicUrl ¶
func (m *LinkMessage) SetPicUrl(picUrl string) *LinkMessage
SetPicUrl set LinkMessage#Link.PicUrl
func (*LinkMessage) SetText ¶
func (m *LinkMessage) SetText(text string) *LinkMessage
SetText set LinkMessage#Links.text
func (*LinkMessage) SetTitle ¶
func (m *LinkMessage) SetTitle(title string) *LinkMessage
SetTitle set LinkMessage#Link.Title
func (*LinkMessage) ToMessageMap ¶
func (m *LinkMessage) ToMessageMap() map[string]interface{}
type MarkdownMessage ¶
type MarkdownMessage struct { BaseMessage At // Title 首屏会话透出的展示内容 Title string // Text markdown格式的消息 Text string }
MarkdownMessage markdown类型
func NewMarkdownMessage ¶
func NewMarkdownMessage() *MarkdownMessage
NewMarkdownMessage create MarkdownMessage
func (*MarkdownMessage) SetText ¶
func (m *MarkdownMessage) SetText(text string) *MarkdownMessage
SetText set MarkdownMessage.Text
func (*MarkdownMessage) SetTitle ¶
func (m *MarkdownMessage) SetTitle(title string) *MarkdownMessage
SetTitle set MarkdownMessage.Title
func (*MarkdownMessage) ToMessageMap ¶
func (m *MarkdownMessage) ToMessageMap() map[string]interface{}
type SingleActionCardMessage ¶
type SingleActionCardMessage struct { BaseMessage ActionCard // SingleTitle 单个按钮的标题 SingleTitle string // 点击singleTitle按钮触发的URL SingleUrl string }
SingleActionCardMessage 整体跳转ActionCard类型
func NewSingleActionCardMessage ¶
func NewSingleActionCardMessage() *SingleActionCardMessage
NewSingleActionCardMessage create SingleActionCardMessage
func (*SingleActionCardMessage) SetSingleTitle ¶
func (m *SingleActionCardMessage) SetSingleTitle(title string) *SingleActionCardMessage
SetSingleTitle set SingleActionCardMessage.SingleTitle
func (*SingleActionCardMessage) SetSingleUrl ¶
func (m *SingleActionCardMessage) SetSingleUrl(singleUrl string) *SingleActionCardMessage
SetSingleUrl set SingleActionCardMessage.SingleUrl
func (*SingleActionCardMessage) ToMessageMap ¶
func (m *SingleActionCardMessage) ToMessageMap() map[string]interface{}
type TextMessage ¶
type TextMessage struct { BaseMessage At // Content 消息内容 Content string }
TextMessage 文本消息
func (*TextMessage) SetContent ¶
func (m *TextMessage) SetContent(content string) *TextMessage
SetContent set TextMessage.Content
func (*TextMessage) ToMessageMap ¶
func (m *TextMessage) ToMessageMap() map[string]interface{}