Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Commit e647467

Browse files
committed
放弃修改主版本v3导入路径,将v3作为v1的一次更新
1 parent cac11d0 commit e647467

12 files changed

+51
-744
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# CoolQ Golang SDK
22
这是酷Q插件原生Go语言SDK
3-
[![GoDoc](https://img.shields.io/badge/pkg-documents-blue.svg)](https://pkg.go.dev/github.com/Tnze/CoolQ-Golang-SDK/v3/cqp?tab=doc)
3+
[![GoDoc](https://img.shields.io/badge/pkg-documents-blue.svg)](https://pkg.go.dev/github.com/Tnze/CoolQ-Golang-SDK/cqp?tab=doc)
44

5-
当前版本:`v3`导入路径:`github.com/Tnze/CoolQ-Golang-SDK/v3/cqp`
5+
导入路径:`github.com/Tnze/CoolQ-Golang-SDK/cqp`
66

77
把Go代码编译成dll,而不是基于http接口的网络调用,提高程序运行效率。
88
如果使用中遇到问题,请大胆提issue**喜欢也请Star支持哦**
@@ -22,7 +22,7 @@
2222

2323
```batch
2424
# 安装cqcfg,请确保`$GOBIN`在当前`PATH`环境变量中
25-
go get github.com/Tnze/CoolQ-Golang-SDK/v3/tools/cqcfg
25+
go get github.com/Tnze/CoolQ-Golang-SDK/tools/cqcfg
2626
# 查看cqcfg是否安装完成
2727
cqcfg -v
2828
# 运行

app.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
package main
33

44
import (
5-
"github.com/Tnze/CoolQ-Golang-SDK/v3/cqp"
5+
"github.com/Tnze/CoolQ-Golang-SDK/cqp"
66
)
77

8+
//go:generate cqcfg -c .
9+
// cqp: 名称: 插件名称
10+
// cqp: 版本: 1.0.0:1
11+
// cqp: 作者: 插件作者姓名
12+
// cqp: 简介: 您插件的简介
813
func main() { cqp.Main() }
914

1015
func init() {
1116
// AppID 需要修改为你的插件的AppID
1217
cqp.AppID = "your.app.id"
13-
cqp.PrivateMsg = onPrivateMsg
1418
cqp.Enable = func() int32 {
1519
return 0
1620
}
1721
}
18-
19-
// TODO: 恢复空插件
20-
func onPrivateMsg(subType, msgID int32, fromQQ int64, msg string, font int32) int32 {
21-
cqp.SendPrivateMsg(fromQQ, msg) //复读机
22-
return 0
23-
}

app.json

+21-146
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,22 @@
1-
{
2-
"ret": 1, // 返回码,固定为1
3-
"apiver": 9, // Api版本,本SDK为9
4-
"name": "GoCQ", // 应用名称
5-
"version": "1.0.0", // 应用版本
6-
"version_id": 1, // 应用顺序版本(每次发布时至少+1)
7-
"author": "Your Name", // 应用作者
8-
"description": "Golang酷Q样例应用(V9应用机制)",
9-
"event": [ // 事件列表,同一事件类型可重复定义(发布前请删除无用事件)
10-
{
11-
"id": 1003,
12-
"type": 1003,
13-
"name": "插件启用",
14-
"priority": 20000,
15-
"function": "EVENT_ON_ENABLE"
16-
},
17-
{
18-
"id": 1004,
19-
"type": 1004,
20-
"name": "插件停用",
21-
"priority": 20000,
22-
"function": "EVENT_ON_DISABLE"
23-
},
24-
{
25-
"id": 1001,
26-
"type": 1001,
27-
"name": "酷Q启动",
28-
"priority": 20000,
29-
"function": "EVENT_ON_START"
30-
},
31-
{
32-
"id": 1002,
33-
"type": 1002,
34-
"name": "酷Q退出",
35-
"priority": 20000,
36-
"function": "EVENT_ON_EXIT"
37-
},
38-
{
39-
"id": 1,
40-
"type": 21,
41-
"name": "私聊消息",
42-
"function": "EVENT_ON_PRIVATE_MSG",
43-
"priority": 20000
44-
},
45-
{
46-
"id": 2,
47-
"type": 2,
48-
"name": "群消息",
49-
"function": "EVENT_ON_GROUP_MSG",
50-
"priority": 20000
51-
},
52-
{
53-
"id": 3,
54-
"type": 4,
55-
"name": "讨论组消息",
56-
"function": "EVENT_ON_DISCUSS_MSG",
57-
"priority": 20000
58-
},
59-
{
60-
"id": 4,
61-
"type": 11,
62-
"name": "群文件上传",
63-
"function": "EVENT_ON_GROUP_UPLOAD",
64-
"priority": 20000
65-
},
66-
{
67-
"id": 5,
68-
"type": 101,
69-
"name": "群管理员变动",
70-
"function": "EVENT_ON_GROUP_ADMIN",
71-
"priority": 20000
72-
},
73-
{
74-
"id": 6,
75-
"type": 102,
76-
"name": "群成员减少",
77-
"function": "EVENT_ON_GROUP_MEMBER_DECREASE",
78-
"priority": 20000
79-
},
80-
{
81-
"id": 7,
82-
"type": 103,
83-
"name": "群成员增加",
84-
"function": "EVENT_ON_GROUP_MEMBER_INCREASE",
85-
"priority": 20000
86-
},
87-
{
88-
"id": 10,
89-
"type": 201,
90-
"name": "好友添加",
91-
"function": "EVENT_ON_FRIEND_ADD",
92-
"priority": 20000
93-
},
94-
{
95-
"id": 8,
96-
"type": 301,
97-
"name": "加好友请求",
98-
"function": "EVENT_ON_FRIEND_REQUEST",
99-
"priority": 20000
100-
},
101-
{
102-
"id": 9,
103-
"type": 302,
104-
"name": "加群请求/邀请",
105-
"function": "EVENT_ON_GROUP_REQUEST",
106-
"priority": 20000
107-
}
108-
],
109-
"menu": [
110-
// 由于Go编写GUI有困难,此处暂时空着
111-
// 如有强烈的需求要用到菜单,可以自行
112-
// 导出函数并写在此处,用户点击按钮时即会被调用。
113-
// {
114-
// "name": "菜单一", //菜单名称
115-
// "function": "YOUR_HANDLE_FUNCTION" //菜单对应函数
116-
// }
117-
],
118-
"status": [ // 悬浮窗状态
119-
],
120-
"auth": [
121-
//20, //[敏感]取Cookies getCookies / getCsrfToken
122-
//30, //接收语音 getRecord
123-
101, //发送群消息 sendGroupMsg
124-
103, //发送讨论组消息 sendDiscussMsg
125-
106, //发送私聊消息 sendPrivateMsg
126-
//110, //[敏感]发送赞 sendLike
127-
120, //置群员移除 setGroupKick
128-
121, //置群员禁言 setGroupBan
129-
122, //置群管理员 setGroupAdmin
130-
123, //置全群禁言 setGroupWholeBan
131-
124, //置匿名群员禁言 setGroupAnonymousBan
132-
125, //置群匿名设置 setGroupAnonymous
133-
126, //置群成员名片 setGroupCard
134-
//127, //[敏感]置群退出 setGroupLeave
135-
128, //置群成员专属头衔 setGroupSpecialTitle
136-
130, //取群成员信息 getGroupMemberInfo
137-
131, //取陌生人信息 getStrangerInfo
138-
132, //取群信息 getGroupInfo
139-
140, //置讨论组退出 setDiscussLeave
140-
150, //置好友添加请求 setFriendAddRequest
141-
151, //置群添加请求 setGroupAddRequest
142-
160, //取群成员列表 getGroupMemberList
143-
161, //取群列表 getGroupList
144-
162, //取好友列表 getFriendList
145-
180 //撤回消息 deleteMsg
146-
]
1+
{
2+
"ret": 1,
3+
"apiver": 9,
4+
"appid": "your.app.id",
5+
"name": "插件名称",
6+
"version": "1.0.0",
7+
"version_id": 1,
8+
"author": "插件作者姓名",
9+
"description": "您插件的简介",
10+
"event": [
11+
{
12+
"name": "插件启用",
13+
"function": "EVENT_ON_ENABLE",
14+
"type": 1003,
15+
"priority": 20000,
16+
"id": 1003
17+
}
18+
],
19+
"auth": null,
20+
"menu": [],
21+
"status": []
14722
}

0 commit comments

Comments
 (0)