message

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package message 消息

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Title        string `json:"title"`
	PagePath     string `json:"pagepath"`
	ThumbMediaID string `json:"thumb_media_id"`
}

Card 卡片消息

func (Card) SendTo

func (msg Card) SendTo(openID, token string) (wres weapp.Response, err error)

SendTo 发送卡片消息

@openID 用户openID @token 微信 access_token

type Image

type Image struct {
	MediaID string `json:"media_id"`
}

Image 图片消息

func (Image) SendTo

func (msg Image) SendTo(openID, token string) (wres weapp.Response, err error)

SendTo 发送图片消息

@openID 用户openID @token 微信 access_token

type Link struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
	ThumbURL    string `json:"thumb_url"`
}

Link 图文链接消息

func (Link) SendTo

func (msg Link) SendTo(openID, token string) (wres weapp.Response, err error)

SendTo 发送图文链接消息

@openID 用户openID @token 微信 access_token

type MsgType

type MsgType string

MsgType 消息类型

const (
	// TextMsg 文本消息类型
	TextMsg MsgType = "text"

	// ImgMsg 图片消息类型
	ImgMsg MsgType = "image"

	// LinkMsg 图文链接消息类型
	LinkMsg MsgType = "link"

	// CardMsg 小程序卡片消息类型
	CardMsg MsgType = "miniprogrampage"

	// Event 事件类型
	Event MsgType = "event"
)

type Text

type Text struct {
	Content string `json:"content"`
}

Text 文本消息 支持添加可跳转小程序的文字链

func (Text) SendTo

func (msg Text) SendTo(openID, token string) (wres weapp.Response, err error)

SendTo 发送文本消息

@openID 用户openID @token 微信 access_token

Directories

Path Synopsis
Package template 模版消息
Package template 模版消息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL