robot

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entitiy

type Entitiy struct {
	Length int    `json:"length"`
	Offset int    `json:"offset"`
	Type   string `json:"type"`
}

type GifResult

type GifResult struct {
	URL string `json:"url"` // gif完整路径
	// option
	Width  int `json:"width,omitempty"`
	Height int `json:"height,omitempty"`
}

gif 结果

type InlineQuery

type InlineQuery struct {
	SID         string `json:"sid"`
	ChannelID   string `json:"channel_id"`
	ChannelType uint8  `json:"channel_type"`
	FromUID     string `json:"from_uid"` // 发送者uid
	Query       string `json:"query"`    // 查询关键字
	Offset      string `json:"offset"`
}

type InlineQueryResult

type InlineQueryResult struct {
	InlineQuerySID string `json:"inline_query_sid"`
	// 结果类型
	Type ResultType `json:"type"`
	// 结果ID
	ID         string                   `json:"id"`
	Results    []map[string]interface{} `json:"results,omitempty"`
	NextOffset string                   `json:"next_offset,omitempty"`
}

func (*InlineQueryResult) Check

func (i *InlineQueryResult) Check() error

type Manager

type Manager struct {
	log.Log
	// contains filtered or unexported fields
}

func NewManager

func NewManager(ctx *config.Context) *Manager

func (*Manager) Route

func (m *Manager) Route(r *wkhttp.WKHttp)

路由配置

type MessageReq

type MessageReq struct {
	Setting     uint8                  `json:"setting"`
	ChannelID   string                 `json:"channel_id"`
	ChannelType uint8                  `json:"channel_type"`
	StreamNo    string                 `json:"stream_no"`
	Entities    []*Entitiy             `json:"entities"`
	Payload     map[string]interface{} `json:"payload"`
}

type ResultType

type ResultType string
const (
	ResultTypeGIF ResultType = "gif"
)

type Robot

type Robot struct {
	log.Log
	// contains filtered or unexported fields
}

func New

func New(ctx *config.Context) *Robot

func (*Robot) Route

func (rb *Robot) Route(r *wkhttp.WKHttp)

Route 路由配置

type RobotCMDType

type RobotCMDType string

机器人命令类型

const (
	None   RobotCMDType = "none"
	Inline RobotCMDType = "inline"
	Link   RobotCMDType = "link"
)

type RobotStatus

type RobotStatus int

机器人状态

const (
	Enable    RobotStatus = 1
	DisEnable RobotStatus = 0
)

type TypingReq

type TypingReq struct {
	ChannelID   string `json:"channel_id"`
	ChannelType uint8  `json:"channel_type"`
}

Jump to

Keyboard shortcuts

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