coolq

package
v0.9.34-fix1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: AGPL-3.0 Imports: 28 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForceFragmented = false
View Source
var IgnoreInvalidCQCode = false
View Source
var Version = "unknown"

Functions

func CQCodeEscapeText added in v0.9.16

func CQCodeEscapeText(raw string) string

func CQCodeEscapeValue added in v0.9.18

func CQCodeEscapeValue(value string) string

func CQCodeUnescapeText added in v0.9.16

func CQCodeUnescapeText(content string) string

func CQCodeUnescapeValue added in v0.9.18

func CQCodeUnescapeValue(content string) string

func SetMessageFormat added in v0.9.18

func SetMessageFormat(f string)

func ToFormattedMessage added in v0.9.18

func ToFormattedMessage(e []message.IMessageElement, code int64, raw ...bool) (r interface{})

func ToGlobalId

func ToGlobalId(code int64, msgId int32) int32

func ToStringMessage

func ToStringMessage(e []message.IMessageElement, code int64, raw ...bool) (r string)

func XmlEscape added in v0.9.31

func XmlEscape(c string) string

Types

type CQBot

type CQBot struct {
	Client *client.QQClient
	// contains filtered or unexported fields
}

func NewQQBot

func NewQQBot(cli *client.QQClient, conf *global.JsonConfig) *CQBot

func (*CQBot) CQCanSendImage

func (bot *CQBot) CQCanSendImage() MSG

func (*CQBot) CQCanSendRecord

func (bot *CQBot) CQCanSendRecord() MSG

func (*CQBot) CQGetForwardMessage added in v0.9.3

func (bot *CQBot) CQGetForwardMessage(resId string) MSG

func (*CQBot) CQGetGroupFileSystemInfo added in v0.9.30

func (bot *CQBot) CQGetGroupFileSystemInfo(groupId int64) MSG

func (*CQBot) CQGetGroupFileUrl added in v0.9.30

func (bot *CQBot) CQGetGroupFileUrl(groupId int64, fileId string, busId int32) MSG

func (*CQBot) CQGetGroupFilesByFolderId added in v0.9.30

func (bot *CQBot) CQGetGroupFilesByFolderId(groupId int64, folderId string) MSG

func (*CQBot) CQGetGroupRootFiles added in v0.9.30

func (bot *CQBot) CQGetGroupRootFiles(groupId int64) MSG

func (*CQBot) CQGetGroupSystemMessages added in v0.9.30

func (bot *CQBot) CQGetGroupSystemMessages() MSG

func (*CQBot) CQGetImage

func (bot *CQBot) CQGetImage(file string) MSG

func (*CQBot) CQGetMessage added in v0.9.29

func (bot *CQBot) CQGetMessage(messageId int32) MSG

func (*CQBot) CQGetVersionInfo

func (bot *CQBot) CQGetVersionInfo() MSG

func (*CQBot) CQGetVipInfo added in v0.9.24

func (bot *CQBot) CQGetVipInfo(userId int64) MSG

func (*CQBot) CQGetWordSlices added in v0.9.27

func (bot *CQBot) CQGetWordSlices(content string) MSG

func (*CQBot) CQOcrImage added in v0.9.26

func (bot *CQBot) CQOcrImage(imageId string) MSG

func (*CQBot) CQReloadEventFilter added in v0.9.25

func (bot *CQBot) CQReloadEventFilter() MSG

func (*CQBot) CQSendGroupForwardMessage added in v0.9.4

func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG

func (*CQBot) CQSetGroupMemo added in v0.9.24

func (bot *CQBot) CQSetGroupMemo(groupId int64, msg string) MSG

func (*CQBot) CQSetGroupName

func (bot *CQBot) CQSetGroupName(groupId int64, name string) MSG

func (*CQBot) CQSetGroupPortrait added in v0.9.26

func (bot *CQBot) CQSetGroupPortrait(groupId int64, file, cache string) MSG

func (*CQBot) ConvertObjectMessage added in v0.9.4

func (bot *CQBot) ConvertObjectMessage(m gjson.Result, group bool) (r []message.IMessageElement)

func (*CQBot) ConvertStringMessage

func (bot *CQBot) ConvertStringMessage(msg string, group bool) (r []message.IMessageElement)

func (*CQBot) GetMessage added in v0.9.29

func (bot *CQBot) GetMessage(mid int32) MSG

func (*CQBot) InsertGroupMessage

func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) int32

func (*CQBot) InsertPrivateMessage added in v0.9.29

func (bot *CQBot) InsertPrivateMessage(m *message.PrivateMessage) int32

func (*CQBot) OnEventPush

func (bot *CQBot) OnEventPush(f func(m MSG))

func (*CQBot) Release

func (bot *CQBot) Release()

func (*CQBot) SendGroupMessage

func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int32

func (*CQBot) SendPrivateMessage

func (bot *CQBot) SendPrivateMessage(target int64, m *message.SendingMessage) int32

func (*CQBot) ToElement

func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (m interface{}, err error)

ToElement 将解码后的CQCode转换为Element. 返回 interface{} 存在三种类型 message.IMessageElement []message.IMessageElement nil

type CloudMusicElement added in v0.9.28

type CloudMusicElement struct {
	MusicElement
}

type GiftElement added in v0.9.27

type GiftElement struct {
	Target int64
	GiftId message.GroupGift
}

func (*GiftElement) Type added in v0.9.27

func (e *GiftElement) Type() message.ElementType

type MSG

type MSG map[string]interface{}

func Failed

func Failed(code int, msg ...string) MSG

func OK

func OK(data interface{}) MSG

func ToArrayMessage added in v0.9.18

func ToArrayMessage(e []message.IMessageElement, code int64, raw ...bool) (r []MSG)

func (MSG) ToJson

func (m MSG) ToJson() string

type MiguMusicElement added in v0.9.30

type MiguMusicElement struct {
	MusicElement
}

type MusicElement added in v0.9.28

type MusicElement struct {
	Title      string
	Summary    string
	Url        string
	PictureUrl string
	MusicUrl   string
}

func (*MusicElement) Type added in v0.9.28

func (e *MusicElement) Type() message.ElementType

type PokeElement added in v0.9.25

type PokeElement struct {
	Target int64
}

func (*PokeElement) Type added in v0.9.25

func (e *PokeElement) Type() message.ElementType

type QQMusicElement added in v0.9.28

type QQMusicElement struct {
	MusicElement
}

Jump to

Keyboard shortcuts

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