coolq

package
v0.9.24 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: AGPL-3.0 Imports: 26 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)

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) CQGetGroupMessage

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

func (*CQBot) CQGetImage

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

func (*CQBot) CQGetStatus

func (bot *CQBot) CQGetStatus() 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) 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) 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(m string, group bool) (r []message.IMessageElement)

func (*CQBot) GetGroupMessage

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

func (*CQBot) InsertGroupMessage

func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) 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) SendNewPic added in v0.9.24

func (bot *CQBot) SendNewPic(elem message.IMessageElement, source string, icon string, minwidth int64, minheigt int64, maxwidth int64, maxheight int64, group bool) (*message.ServiceElement, error)

SendNewPic 一种xml 方式发送的群消息图片

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) (message.IMessageElement, error)

type MSG

type MSG map[string]interface{}

func Failed

func Failed(code int) 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

Jump to

Keyboard shortcuts

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