Documentation ¶
Index ¶
- Constants
- Variables
- type Article
- type CDATA
- type Context
- func (ctx *Context) AppID() string
- func (ctx *Context) ReplyImageMsg(mediaID string) error
- func (ctx *Context) ReplyMusicMsg(title, descr, musicURL, hqMusicURL, thumbMediaID string) error
- func (ctx *Context) ReplyNewsMsg(articles []*Article) error
- func (ctx *Context) ReplyTextMsg(content string) error
- func (ctx *Context) ReplyVideoMsg(title, descr, MediaID string) error
- func (ctx *Context) ReplyVoiceMsg(mediaID string) error
- func (ctx *Context) SafeMode() bool
- func (ctx *Context) Transfer2CustomerService(kfAccount ...string) error
- type Handler
- type MemoryStore
- type ReqMsg
- type Server
- type Store
Constants ¶
View Source
const ( // 消息类型 MsgTypeText = "text" // 文本消息 MsgTypeImage = "image" // 图片消息 MsgTypeVoice = "voice" // 语音消息 MsgTypeVideo = "video" // 视频消息 MsgTypeShortVideo = "shortvideo" // 小视频消息 MsgTypeLocation = "location" // 地理位置消息 MsgTypeLink = "link" // 链接消息 // 事件类型 EvtTypeSubscribe = "subscribe" // 关注事件/用户未关注时扫描带参数二维码事件 EvtTypeUnsubscribe = "unsubscribe" // 取消关注事件 EvtTypeScan = "SCAN" // 用户已关注时扫描带参数二维码事件 EvtTypeLocation = "LOCATION" // 上报地理位置事件 EvtTypeClick = "CLICK" // 自定义菜单拉取消息事件 EvtTypeView = "VIEW" // 自定义菜单跳转链接事件 )
Variables ¶
View Source
var ( ErrTokenNotFound = errors.New("token is not found in store") ErrEncodingAESKeyNotFound = errors.New("encoding aes key is not found in store") )
Functions ¶
This section is empty.
Types ¶
type Context ¶
func (*Context) ReplyMusicMsg ¶
被动回复音乐消息
func (*Context) ReplyVideoMsg ¶
被动回复视频消息
func (*Context) Transfer2CustomerService ¶
将消息转发到客服
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) GetEncodingAESKey ¶
func (sto *MemoryStore) GetEncodingAESKey(appID string) (encodingAESKey string, err error)
func (*MemoryStore) GetToken ¶
func (sto *MemoryStore) GetToken(appID string) (token string, err error)
func (*MemoryStore) SetEncodingAESKey ¶
func (sto *MemoryStore) SetEncodingAESKey(appID, encodingAESKey string)
func (*MemoryStore) SetToken ¶
func (sto *MemoryStore) SetToken(appID, token string)
type ReqMsg ¶
type ReqMsg struct { XMLName xml.Name `xml:"xml"` Encrypt string ToUserName string // 开发者微信号 FromUserName string // 发送方OpenID CreateTime int64 // 消息创建时间 MsgType string // 消息类型 // 普通消息参数 Content string // 文本消息内容 PicURL string `xml:"PicUrl"` // 图片链接 MediaID string `xml:"MediaId"` // 图片/语音/视频消息媒体ID Format string // 语音格式 Recognition string // 语音识别结果 ThumbMediaID string `xml:"ThumbMediaId"` // 视频消息缩略图的媒体ID LocationX float64 `xml:"Location_X"` // 地理位置维度 LocationY float64 `xml:"Location_Y"` // 地理位置经度 Scale int // 地图缩放大小 Label string // 地理位置信息 Title string // 消息标题 Description string // 消息描述 URL string `xml:"Url"` // 消息链接 MsgID int64 `xml:"MsgId"` // 消息ID // 事件推送参数 Event string // 事件类型 EventKey string // 事件KEY值 Ticket string // 二维码的Ticket Latitude float64 // 地理位置纬度 Longitude float64 // 地理位置经度 Precision float64 // 地理位置精度 }
Click to show internal directories.
Click to hide internal directories.