qq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() (string, error)

func Release

func Release(session string)

func SendGroupMessage

func SendGroupMessage(target int, text string)

func ServeMirai

func ServeMirai()

ServeMirai 开启 Mirai事件上报监听器

func UploadGroupImage

func UploadGroupImage()

Types

type Event

type Event struct {
	Type         string        `json:"type"`
	MessageChain MessageChains `json:"messageChain"`
	QQ           int           `json:"qq"`
	Sender       struct {
		ID         int    `json:"id"`
		MemberName string `json:"memberName"`
		Permission string `json:"permission"`
		Nickname   string `json:"nickname"`
		Remark     string `json:"remark"`
		Group      struct {
			ID         int    `json:"id"`
			Name       string `json:"name"`
			Permission string `json:"permission"`
		} `json:"group"`
	} `json:"sender"`
}

Event Mirai 上报的事件

func NewEvent

func NewEvent(b []byte) *Event

func (Event) IsFriendMessage

func (e Event) IsFriendMessage() bool

func (Event) IsGroupMessage

func (e Event) IsGroupMessage() bool

func (Event) IsMessage

func (e Event) IsMessage() bool

func (Event) String

func (e Event) String() string

type MessageChain

type MessageChain struct {
	Type    string      `json:"type"`
	ID      int         `json:"id,omitempty"`
	Time    int         `json:"time,omitempty"`
	Target  int         `json:"target,omitempty"`
	Display string      `json:"display,omitempty"`
	Text    string      `json:"text,omitempty"`
	ImageID string      `json:"imageId,omitempty"`
	URL     string      `json:"url,omitempty"`
	Path    interface{} `json:"path,omitempty"`
	FaceID  int         `json:"faceId,omitempty"`
	Name    string      `json:"name,omitempty"`
}

type MessageChains

type MessageChains []MessageChain

MessageChains Mirai 上报事件中的 Message

func (MessageChains) PlainText

func (cs MessageChains) PlainText() string

type SendMessage

type SendMessage struct {
	SessionKey   string        `json:"sessionKey"`
	Target       int           `json:"target"`
	MessageChain MessageChains `json:"messageChain"`
}

func NewSendMessage

func NewSendMessage(session string, target int, text string) *SendMessage

type SendMessageResponse

type SendMessageResponse struct {
	Code      int    `json:"code"`
	Msg       string `json:"msg"`
	MessageID int    `json:"messageId"`
}

Jump to

Keyboard shortcuts

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