Documentation ¶
Index ¶
- Constants
- func New(setting map[string]string) (sender.Sender, error)
- type Message
- type Sender
- func (sender *Sender) CheckSignature(timestamp, nonce, msgEnctypt, signature string) bool
- func (sender *Sender) DecryptMessage(msgEncrypt string) ([]byte, error)
- func (sender *Sender) Send(title, msg string, from string, receivers []string) (int, error)
- func (sender *Sender) SendGroupChat(chatid, data string) error
- type Token
- type WeMessage
Constants ¶
View Source
const ( ReceiversPartialInvalid = "partial receivers invalid" ReceiversAllInvalid = "all receivers invalid" Name = "qywechat" )
内置变量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { ToUser string `json:"touser"` MsgType string `json:"msgtype"` AgentID int `json:"agentid"` Text struct { Content string `json:"content"` } `json:"text,omitempty"` TextCard struct { Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` BtnTxt string `json:"btntxt"` } `json:"textcard,omitempty"` }
Message entity post to wechat api
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender can send message to wechat
func (*Sender) CheckSignature ¶
CheckSignature check if the message is safe
func (*Sender) DecryptMessage ¶
DecryptMessage decrypt the message
func (*Sender) SendGroupChat ¶
SendGroupChat sends msg to group chat
type Token ¶
type Token struct { Token string `json:"access_token"` Expire int `json:"expires_in"` // contains filtered or unexported fields }
Token is the access token used to send message to wechat
type WeMessage ¶
type WeMessage struct { ToUser string `xml:"ToUserName"` FromUser string `xml:"FromUserName"` CreateTime int `xml:"CreateTime"` MsgType string `xml:"MsgType"` Content string `xml:"Content"` MsgID string `xml:"MsgId"` AgentID int }
WeMessage represent the message from the wechat reply
Click to show internal directories.
Click to hide internal directories.