worktool

package
v1.0.90 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiWorkTool

type ApiWorkTool interface {
	SendFile(targets []string, file File) error
	SendText(targets []string, content string, atPeoples ...string) error
}

func New

func New(robotId string) ApiWorkTool

type File

type File struct {
	Name    string `json:"objectName"` // 对象名,这里代表文件名
	Url     string `json:"fileUrl"`    // 文件路径
	Kind    string `json:"fileType"`   // 文件类型 image等
	Comment string `json:"extraText"`  // 附件流言 可选填
}

type FileMessage

type FileMessage struct {
	Kind    MsgKind  `json:"type"`
	Targets []string `json:"titleList"` // 发送人列表
	File
}

type MessageBody

type MessageBody struct {
	SocketType int   `json:"socketType"`
	List       []any `json:"list"`
}

type MsgKind

type MsgKind int
const (
	MsgKindText MsgKind = 203
	MsgKindFile MsgKind = 218
)

type Response

type Response struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data"`
}

type TextMessage

type TextMessage struct {
	Kind      MsgKind  `json:"type"`            // 消息类型
	Targets   []string `json:"titleList"`       // 发送目标,可以为联系人或者群
	Content   string   `json:"receivedContent"` // 文本内容 (\n换行)
	AtPeoples []string `json:"atList"`          // @人列表
}

Jump to

Keyboard shortcuts

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