Documentation ¶
Index ¶
- Constants
- Variables
- func SanitizeMarkdown(content string) string
- func ValidMsgtype(msgtype string) bool
- type Article
- type ArticleForMPNews
- type Btn
- type File
- type Image
- type InteractiveTaskcard
- type KV
- type MPNews
- type Markdown
- type MiniprogramNotice
- type Msg
- func NewMsgFile(file *File) *Msg
- func NewMsgFileFromPayload(payload *models.Payload) *Msg
- func NewMsgImage(mediaID string) *Msg
- func NewMsgImageFromPayload(payload *models.Payload) *Msg
- func NewMsgMarkdown(content string) *Msg
- func NewMsgMarkdownFromPayload(payload *models.Payload) *Msg
- func NewMsgNews(articles []*Article) *Msg
- func NewMsgNewsFromPayload(payload *models.Payload) *Msg
- func NewMsgText(content string) *Msg
- func NewMsgTextFromPayload(payload *models.Payload) *Msg
- type News
- type Notifier
- type Sender
- type Text
- type TextCard
- type Video
- type Voice
Constants ¶
View Source
const ( MsgTypeText = "text" MsgTypeFile = "file" MsgTypeImage = "image" MsgTypeVoice = "voice" MsgTypeVideo = "video" MsgTypeNews = "news" MsgTypeMPNews = "mpnews" MsgTypeTextCard = "textcard" MsgTypeMarkdown = "markdown" MsgTypeMiniprogramNotice = "miniprogram_notice" MsgTypeInteractiveCard = "interactive_card" )
View Source
const ChannelTypeWeixin = "weixinapp"
Variables ¶
View Source
var ErrCodeAboutTokens = []int{
40014,
42001,
}
ErrCodeAboutTokens contains weixinapp https://work.weixin.qq.com/api/doc/90000/90139/90313
View Source
var SupportedMsgtype = make(map[string]bool)
Functions ¶
func SanitizeMarkdown ¶
func ValidMsgtype ¶
Types ¶
type Article ¶
type Article struct { Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` // 点击后跳转的链接 PicURL string `json:"picurl"` // 图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图 1068*455,小图150*150 }
func NewArticle ¶
func (*Article) SetDescription ¶
type ArticleForMPNews ¶
type InteractiveTaskcard ¶
type Markdown ¶
type Markdown struct {
Content string `json:"content"` // this should be raw markdown string, weixin bot only support a small subset syntax
}
type MiniprogramNotice ¶
type Msg ¶
type Msg struct { MsgType string `json:"msgtype"` AgentID int `json:"agentid"` // touser、toparty、totag不能同时为空 ToUser string `json:"touser,omitempty"` ToParty string `json:"toparty,omitempty"` ToTag string `json:"totag,omitempty"` Text *Text `json:"text,omitempty"` Image *Image `json:"image,omitempty"` Voice *Voice `json:"voice,omitempty"` File *File `json:"file,omitempty"` TextCard *TextCard `json:"textcard,omitempty"` News *News `json:"news,omitempty"` MPNews *MPNews `json:"mpnews,omitempty"` Markdown *Markdown `json:"markdown,omitempty"` MiniprogramNotice *MiniprogramNotice `json:"miniprogram_notice,omitempty"` InteractiveTaskcard *InteractiveTaskcard `json:"interactive_taskcard,omitempty"` Safe int `json:"safe,omitempty"` EnableIDTrans int `json:"enable_id_trans,omitempty"` DuplicateCheckInterval int `json:"duplicate_check_interval,omitempty"` }
func NewMsgFile ¶
func NewMsgFileFromPayload ¶
func NewMsgImage ¶
func NewMsgImageFromPayload ¶
func NewMsgMarkdown ¶
func NewMsgNews ¶
func NewMsgNewsFromPayload ¶
func NewMsgText ¶
func NewMsgTextFromPayload ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func (*Notifier) AddrForGetToken ¶
func (*Notifier) ShouldGetToken ¶
Click to show internal directories.
Click to hide internal directories.