Documentation
¶
Index ¶
- type CodeContent
- type ImageContent
- type MarkdownContent
- type MessageMeta
- type NewsContent
- type TextContent
- type WeChatBot
- func (b *WeChatBot) Alarm(conf *WebChatBotConfigItem, atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Debug(atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Default(atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Error(atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Info(atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Task(atMe bool, format string, args ...interface{}) (err error)
- func (b *WeChatBot) Warn(atMe bool, format string, args ...interface{}) (err error)
- type WeChatBotConfig
- type WebChatBotConfigItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeContent ¶
代码类型:
type ImageContent ¶
图片:
type MessageMeta ¶
type MessageMeta struct {
MsgType string `json:"msgtype"`
Text *TextContent `json:"text,omitempty"`
Markdown *MarkdownContent `json:"markdown,omitempty"`
Image *ImageContent `json:"image,omitempty"`
News *NewsContent `json:"news,omitempty"`
}
消息:
func (*MessageMeta) FromMarkdown ¶
func (m *MessageMeta) FromMarkdown(content string)
FromMarkdown markdown类型
func (*MessageMeta) FromText ¶
func (m *MessageMeta) FromText(content string, atMobileList []string, atNameList []string)
FromText 文本类型
func (*MessageMeta) ToBytes ¶
func (m *MessageMeta) ToBytes() (payload []byte)
type NewsContent ¶
type NewsContent struct {
Articles []struct {
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
PicURL string `json:"picurl"`
} `json:"articles"`
}
新闻:
type TextContent ¶
type TextContent struct {
Content string `json:"content"`
MentionedList []string `json:"mentioned_list"` // at 用户名
MentionedMobileList []string `json:"mentioned_mobile_list"` // 手机号
}
text 消息内容:
type WeChatBot ¶
type WeChatBot struct {
// contains filtered or unexported fields
}
func NewWeChatBot ¶
func NewWeChatBot(conf *WeChatBotConfig) (bot *WeChatBot)
func (*WeChatBot) Alarm ¶
func (b *WeChatBot) Alarm(conf *WebChatBotConfigItem, atMe bool, format string, args ...interface{}) (err error)
type WeChatBotConfig ¶
type WeChatBotConfig struct {
Default *WebChatBotConfigItem
Debug *WebChatBotConfigItem
Info *WebChatBotConfigItem
Warn *WebChatBotConfigItem
Error *WebChatBotConfigItem // error bot
Task *WebChatBotConfigItem // 定时任务 bot
}
Click to show internal directories.
Click to hide internal directories.