robots

package
v0.0.0-...-31439ab Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypePrivate = "private" // 私聊消息
	MessageTypeGroup   = "group"   // 群消息
)
View Source
const (
	SubTypeFriend    = "friend"     // 好友
	SubTypeNormal    = "normal"     // 群聊
	SubTypeAnonymous = "anonymous"  // 	匿名
	SubTypeGroupSelf = "group_self" //	群中自身发送
	SubTypeGroup     = "group"      //群临时会话
	SubTypeNotice    = "notice"     //系统提示
)

Variables

This section is empty.

Functions

func RunRobot

func RunRobot(ctx context.Context, r types.Robot, plugins []types.Plugin)

Types

type CQSendMessage

type CQSendMessage struct {
	GroupId    int64  `json:"group_id"`
	QQId       int    `json:"-"`
	Image      string `json:"-"`
	Message    string `json:"message"`
	AutoEscape bool   `json:"auto_escape"`
}

type CqHttps

type CqHttps struct {
	// contains filtered or unexported fields
}

func NewCqHttps

func NewCqHttps(cfg *svc.CQHttpBot) *CqHttps

func (*CqHttps) Prefix

func (c *CqHttps) Prefix() string

func (*CqHttps) Run

func (c *CqHttps) Run(ch chan<- types.InMessage)

func (*CqHttps) SendMessage

func (c *CqHttps) SendMessage(out types.OutMessage) error

type CqInMessage

type CqInMessage struct {
	MessageType MessageType `json:"message_type"`
	SubType     SubType     `json:"sub_type"`
	MessageId   int32       `json:"message_id"`
	UserId      int64       `json:"user_id"` // QQ
	Message     []Message   `json:"message"` // 消息
	RawMessage  string      `json:"raw_message"`
	Font        int         `json:"font"`     // 字体
	GroupID     int64       `json:"group_id"` // 群号
	Sender      Sender      `json:"sender"`

	MetaEventType string `json:"meta_event_type"`
}

type Message

type Message struct {
	Data struct {
		Text string `json:"text"`
	}
	Type string `json:"type"`
}

type MessageType

type MessageType = string

type Sender

type Sender struct {
	UserId   int64  `json:"user_id"` // QQ
	NickName string `json:"nickname"`
	Sex      string `json:"sex"` //  male 或 female 或 unknown
	Age      int32  `json:"age"`
	Card     string `json:"card"`
	Area     string `json:"area"`
	Level    string `json:"level"`
	Role     string `json:"role"`
	Title    string `json:"title"`
}

type SubType

type SubType = string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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