wclient

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiRequestMsg

func ApiRequestMsg(url, wxid, roomid string) int32

使用接口回复消息 param url string 待请求的接口地址 param wxid string 消息接收人,如果 roomid 存在则为 at 此人 param roomid string 消息接收群,空则为私聊 return string 成功返回空,失败返回错误信息或结果

func ChatRoomInfo added in v0.21.2

func ChatRoomInfo(roomid string) map[string]string

获取群管理信息

func FindMsgDb added in v0.21.2

func FindMsgDb() string

查找消息数据库 return string 消息数据库

func Register

func Register() *wcferry.Client

注册客户端(单例模式)

func SendFlexMsg

func SendFlexMsg(msg, wxid, roomid string) int32

发送弹性消息(文本、卡片、网络图片或文件) 网络文件格式:以 http:// 或 https:// 开头 卡片消息格式:card\n{name}\n{account}\n{title}\n{digest}\n{url}\n{thumburl} param msg string 要发送的消息 param wxid string 消息接收人,如果 roomid 存在则为 at 此人 param roomid string 消息接收群,空则为私聊 return int32 0 为成功,其他失败

func TodayUnix

func TodayUnix() int64

Types

type ApiResponse

type ApiResponse struct {
	Type string `json:"type"` // 数据类型 [card, file, image, text, error]
	Card struct {
		Name    string `json:"name"`    // 左下显示的名字,可选
		Account string `json:"account"` // 公众号 id,可显示对应的头像,可选
		Title   string `json:"title"`   // 标题,最多显示为两行
		Digest  string `json:"digest"`  // 摘要,最多显示为三行
		Link    string `json:"link"`    // 点击后跳转的链接
		Icon    string `json:"icon"`    // 右侧缩略图的链接,可选
	} `json:"card,omitempty"`
	Link string `json:"link,omitempty"` // 当 type 为 file 或 image 时有效
	Text string `json:"text,omitempty"` // 当 type 为 text 或 error 时有效
}

接口响应结果

type RoomData

type RoomData struct {
	Talk  int32 `json:"talk"`
	Image int32 `json:"image"`
}

func RoomCount

func RoomCount(roomid string, day int64) *RoomData

type TopItem

type TopItem struct {
	Sender      string `json:"sender"`
	RecordCount int32  `json:"record_count"`
}

func ImageTop10

func ImageTop10(roomid string, day int64) []*TopItem

func TalkTop10

func TalkTop10(roomid string, day int64) []*TopItem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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