weixin

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MsgTypeText     = "text"
	MsgTypeMarkdown = "markdown"
)
View Source
const Addr = "https://qyapi.weixin.qq.com/cgi-bin"

Variables

This section is empty.

Functions

func SendMessage

func SendMessage(c *httpx.Client, aid int64, token, to string, text string) error

func SendMessageWithMap

func SendMessageWithMap(c *httpx.Client, token string, data map[string]interface{}) error

func SendMessageWithReq

func SendMessageWithReq(c *httpx.Client, token string, req *MessageReq) error

Types

type MessageMarkdown

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

type MessageReq

type MessageReq struct {
	ToUser                 string `json:"touser,omitempty"`
	ToParty                string `json:"toparty,omitempty"`
	ToTag                  string `json:"totag,omitempty"`
	MsgType                string `json:"msgtype"`
	AgentId                int64  `json:"agentid"`
	Safe                   int64  `json:"safe,omitempty"`
	EnableIdTrans          int64  `json:"enable_id_trans,omitempty"`
	EnableDuplicateCheck   int64  `json:"enable_duplicate_check,omitempty"`
	DuplicateCheckInterval int64  `json:"duplicate_check_interval,omitempty"`

	Text     *MessageText     `json:"text,omitempty"`
	Markdown *MessageMarkdown `json:"markdown,omitempty"`
}

type MessageResp

type MessageResp struct {
	ErrCode      int64  `json:"errcode"`
	ErrMsg       string `json:"errmsg"`
	InvalidUser  string `json:"invaliduser"`
	InvalidParty string `json:"invalidparty"`
	InvalidTag   string `json:"invalidtag"`
	MsgId        string `json:"msgid"`
	ResponseCode string `json:"response_code"`
}

type MessageText

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

type TokenResp

type TokenResp struct {
	ErrCode     int    `json:"errcode"`
	ErrMsg      string `json:"errmsg"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

func GetToken

func GetToken(c *httpx.Client, id, secret string) (*TokenResp, error)

Jump to

Keyboard shortcuts

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