Documentation ¶
Index ¶
- Constants
- Variables
- func Escape(txt string) string
- func Marshal(msg Message) []byte
- func PluginRegister(plugins ...pluginInterface)
- func Unmarshal(raw []byte, msg *Message) error
- type CQEvent
- type CQResponse
- type CQTypeGetStatus
- type CQTypeSendGroupMsg
- type CQTypeSendPrivateMsg
- type CQTypeSetGroupBan
- type CQTypeSetGroupKick
- type CQTypeSetGroupWholeBan
- type CQWSMessage
- type Filter
- type Handler
- type Message
- type Number
- type Plugin
- type QAnonymous
- type Section
- type String
Constants ¶
View Source
const ( // ActionSendPrivateMsg 发送私聊消息 ActionSendPrivateMsg = "send_private_msg" // DONE: websocket // ActionSendGroupMsg 发送群消息 ActionSendGroupMsg = "send_group_msg" // DONE: websocket // ActionSetGroupKick 群组踢人 ActionSetGroupKick = "set_group_kick" // DONE: websocket // ActionSetGroupBan 群组单人禁言 ActionSetGroupBan = "set_group_ban" // DONE: websocket // ActionSetGroupWholeBan 群组全员禁言 ActionSetGroupWholeBan = "set_group_whole_ban" // DONE: websocket // ActionGetStatus 获取插件运行状态 ActionGetStatus = "get_status" // DONE: http )
文档: https://cqhttp.cc/docs/4.4/#/API?id=api-列表 大致先做这些...
Variables ¶
View Source
var Client = &cqclient{ apiConn: new(clients.WSClient), eventConn: new(clients.WSClient), pluginEntries: make(map[string]pluginEntry), }
Client 唯一的酷q机器人实体
Functions ¶
Types ¶
type CQEvent ¶
type CQEvent struct { Anonymous QAnonymous `json:"anonymous"` Font int64 `json:"font"` GroupID int64 `json:"group_id"` Message string `json:"message"` MessageID int64 `json:"message_id"` MessageType string `json:"message_type"` PostType string `json:"post_type"` RawMessage string `json:"raw_message"` SelfID int64 `json:"self_id"` SubType string `json:"sub_type"` Time int64 `json:"time"` UserID int64 `json:"user_id"` }
CQEvent coolq事件上报格式
type CQResponse ¶
type CQResponse struct { Status string `json:"status"` RetCode int `json:"retcode"` Data interface{} `json:"data"` Echo int64 `json:"echo"` }
CQResponse coolq ws响应类型
type CQTypeGetStatus ¶
type CQTypeGetStatus struct { AppInitialized bool `json:"app_initialized"` AppEnabled bool `json:"app_enabled"` PluginsGood bool `json:"plugins_good"` AppGood bool `json:"app_good"` Online bool `json:"online"` Good bool `json:"good"` }
CQTypeGetStatus ActionGetStatus的响应数据格式
type CQTypeSendGroupMsg ¶
type CQTypeSendGroupMsg struct { GroupID int64 `json:"group_id"` Message string `json:"message"` AutoEscape bool `json:"auto_escape"` }
CQTypeSendGroupMsg SendGroupMsg动作的数据格式
type CQTypeSendPrivateMsg ¶ added in v0.0.3
type CQTypeSendPrivateMsg struct { UserID int64 `json:"user_id"` Message string `json:"message"` AutoEscape bool `json:"auto_escape"` }
CQTypeSendPrivateMsg ActionSendPrivateMsg动作的数据格式
type CQTypeSetGroupBan ¶ added in v0.0.3
type CQTypeSetGroupBan struct { GroupID int64 `json:"group_id"` UserID int64 `json:"user_id"` Duration int64 `json:"duration"` }
CQTypeSetGroupBan ActionSetGroupBan动作数据格式
type CQTypeSetGroupKick ¶ added in v0.0.3
type CQTypeSetGroupKick struct { GroupID int64 `json:"group_id"` UserID int64 `json:"user_id"` RejectAddRequest bool `json:"reject_add_request"` }
CQTypeSetGroupKick AActionSetGroupKick动作数据格式
type CQTypeSetGroupWholeBan ¶ added in v0.0.3
CQTypeSetGroupWholeBan ActionSetGroupWholeBan动作数据格式
type CQWSMessage ¶
type CQWSMessage struct { Action string `json:"action"` Params interface{} `json:"params"` Echo int64 `json:"echo"` }
CQWSMessage coolq ws基本消息类型
type QAnonymous ¶
QAnonymous QQ匿名消息格式
type Section ¶
Section 消息段落 https://cqhttp.cc/docs/4.4/#/Message
Click to show internal directories.
Click to hide internal directories.