Documentation ¶
Index ¶
- Constants
- func Format(msg MessageType) string
- func MarkdownMessage(text string) string
- func RobotSendMarkDownMessage(key string, content string) error
- func RobotSendMessage(key string, msg MessageType) error
- func RobotSendTextMessage(key, content string, mobiles []string, user ...string) error
- func RobotUrl(key string) (string, error)
- func Upload()
- type CardAction
- type EmphasisContent
- type File
- type HorizontalContentList
- type Image
- type Jump
- type MainTitle
- type Markdown
- type MessageType
- type MsgType
- type News
- type QuoteArea
- type Robot
- type Source
- type TemplateCard
- type Text
- type UploadRes
- type Voice
Constants ¶
View Source
const ( //VERSION is SDK version VERSION = "0.1" //ROOT is the root url ROOT = "https://qyapi.weixin.qq.com/cgi-bin/webhook/" )
View Source
const (
MsgTypeTmpl = `{"msgtype":"%s",%s}`
)
Variables ¶
This section is empty.
Functions ¶
func Format ¶
func Format(msg MessageType) string
func MarkdownMessage ¶
func RobotSendMarkDownMessage ¶
RobotSendMarkDownMessage can send a text message to a group chat
func RobotSendMessage ¶
func RobotSendMessage(key string, msg MessageType) error
func RobotSendTextMessage ¶
Types ¶
type CardAction ¶
type EmphasisContent ¶
type HorizontalContentList ¶
type Image ¶
func (Image) MessageType ¶
type Markdown ¶
type Markdown struct {
Content string `json:"content"`
}
func (*Markdown) MessageType ¶
type MessageType ¶
type MessageType interface {
MessageType() MsgType
}
type MsgType ¶
type MsgType int
const ( MsgTypeText MsgType MsgTypeMarkdown MsgTypeImage MsgTypeFile MsgTypeNews MsgTypeVoice MsgTypeTemplateCard )
type News ¶
type News struct { Articles []struct { Title string `json:"title"` Description string `json:"description"` Url string `json:"url"` Picurl string `json:"picurl"` } `json:"articles"` }
func (*News) MessageType ¶
type Robot ¶
type Robot struct {
Key string
}
func (*Robot) SendMessage ¶
func (r *Robot) SendMessage(msg MessageType) error
type TemplateCard ¶
type TemplateCard struct { CardType string `json:"card_type"` Source Source `json:"source"` MainTitle MainTitle `json:"main_title"` EmphasisContent EmphasisContent `json:"emphasis_content"` QuoteArea QuoteArea `json:"quote_area"` SubTitleText string `json:"sub_title_text"` HorizontalContentList HorizontalContentList `json:"horizontal_content_list"` JumpList Jump `json:"jump_list"` CardAction CardAction `json:"card_action"` }
func (*TemplateCard) MessageType ¶
func (*TemplateCard) MessageType() MsgType
type Text ¶
type Text struct { Content string `json:"content"` MentionedList []string `json:"mentioned_list"` MentionedMobileList []string `json:"mentioned_mobile_list"` }
func (*Text) MessageType ¶
Click to show internal directories.
Click to hide internal directories.