node-karin 0.12.0 → 0.12.2-5.pr.206.027f2f2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1029 -0
- package/default/comment/config.json +34 -0
- package/default/comment/friendDirect.json +10 -0
- package/default/comment/groupGuild.json +11 -0
- package/default/comment/server.json +17 -0
- package/default/config/adapter.json +28 -0
- package/default/config/config.json +47 -0
- package/default/config/groups.json +47 -0
- package/default/config/groups.yaml +70 -0
- package/default/config/pm2.json +16 -0
- package/default/config/privates.json +23 -0
- package/default/config/privates.yaml +31 -0
- package/default/config/redis.json +10 -0
- package/default/config/render.json +19 -0
- package/default/view/group.yaml +73 -0
- package/dist/index.d.ts +9869 -0
- package/dist/index.js +12643 -0
- package/dist/module/art-template.cjs +11 -0
- package/dist/module/art-template.d.ts +1 -0
- package/dist/module/axios.cjs +22 -0
- package/dist/module/axios.d.ts +2 -0
- package/dist/module/chalk.cjs +22 -0
- package/dist/module/chalk.d.ts +2 -0
- package/dist/module/chokidar.cjs +22 -0
- package/dist/module/chokidar.d.ts +2 -0
- package/dist/module/commander.cjs +35 -0
- package/dist/module/commander.d.ts +3 -0
- package/dist/module/commander.js +3 -0
- package/dist/module/dotenv.cjs +22 -0
- package/dist/module/dotenv.d.ts +2 -0
- package/dist/module/dotenv.js +2 -0
- package/dist/module/express.cjs +112 -0
- package/dist/module/express.d.ts +1 -0
- package/dist/module/express.js +1 -0
- package/dist/module/level.cjs +22 -0
- package/dist/module/level.d.ts +2 -0
- package/dist/module/lodash.cjs +11 -0
- package/dist/module/lodash.d.ts +1 -0
- package/dist/module/log4js.cjs +22 -0
- package/dist/module/log4js.d.ts +2 -0
- package/dist/module/moment.cjs +11 -0
- package/dist/module/moment.d.ts +1 -0
- package/dist/module/node-schedule.cjs +22 -0
- package/dist/module/node-schedule.d.ts +2 -0
- package/dist/module/redis.cjs +22 -0
- package/dist/module/redis.d.ts +2 -0
- package/dist/module/ws.cjs +28 -0
- package/dist/module/ws.d.ts +1 -0
- package/dist/module/ws.js +1 -0
- package/dist/module/yaml.cjs +22 -0
- package/dist/module/yaml.d.ts +2 -0
- package/dist/root.d.ts +40 -0
- package/dist/root.js +44 -0
- package/package.json +142 -128
- package/LICENSE +0 -674
- package/README.md +0 -56
- package/config/defSet/App.yaml +0 -42
- package/config/defSet/config.yaml +0 -65
- package/config/defSet/group.yaml +0 -56
- package/config/defSet/pm2.yaml +0 -21
- package/config/defSet/redis.yaml +0 -18
- package/config/defSet/server.yaml +0 -42
- package/config/view/group.yaml +0 -92
- package/lib/adapter/index.d.ts +0 -2
- package/lib/adapter/index.js +0 -2
- package/lib/adapter/input/index.d.ts +0 -78
- package/lib/adapter/input/index.js +0 -205
- package/lib/adapter/onebot/11/convert.d.ts +0 -12
- package/lib/adapter/onebot/11/convert.js +0 -167
- package/lib/adapter/onebot/11/event.d.ts +0 -25
- package/lib/adapter/onebot/11/event.js +0 -442
- package/lib/adapter/onebot/11/index.d.ts +0 -508
- package/lib/adapter/onebot/11/index.js +0 -1047
- package/lib/cli/index.d.ts +0 -92
- package/lib/cli/index.js +0 -307
- package/lib/cli/init.d.ts +0 -2
- package/lib/cli/init.js +0 -22
- package/lib/cli/karin.d.ts +0 -2
- package/lib/cli/karin.js +0 -16
- package/lib/cli/pkg.d.ts +0 -4
- package/lib/cli/pkg.js +0 -14
- package/lib/cli/start.d.ts +0 -1
- package/lib/cli/start.js +0 -8
- package/lib/core/index.d.ts +0 -10
- package/lib/core/index.js +0 -10
- package/lib/core/init/config.d.ts +0 -43
- package/lib/core/init/config.js +0 -201
- package/lib/core/init/dir.d.ts +0 -4
- package/lib/core/init/dir.js +0 -7
- package/lib/core/init/init.d.ts +0 -1
- package/lib/core/init/init.js +0 -47
- package/lib/core/karin/karin.d.ts +0 -198
- package/lib/core/karin/karin.js +0 -226
- package/lib/core/listener/listener.d.ts +0 -145
- package/lib/core/listener/listener.js +0 -235
- package/lib/core/plugin/base.d.ts +0 -156
- package/lib/core/plugin/base.js +0 -131
- package/lib/core/plugin/loader.d.ts +0 -141
- package/lib/core/plugin/loader.js +0 -618
- package/lib/core/process/process.d.ts +0 -18
- package/lib/core/process/process.js +0 -96
- package/lib/core/server/server.d.ts +0 -25
- package/lib/core/server/server.js +0 -295
- package/lib/db/index.d.ts +0 -2
- package/lib/db/index.js +0 -2
- package/lib/db/level/level.d.ts +0 -19
- package/lib/db/level/level.js +0 -36
- package/lib/db/redis/redis.d.ts +0 -2
- package/lib/db/redis/redis.js +0 -135
- package/lib/db/redis/redis_level.d.ts +0 -112
- package/lib/db/redis/redis_level.js +0 -281
- package/lib/event/handler/base.d.ts +0 -42
- package/lib/event/handler/base.js +0 -200
- package/lib/event/handler/message.d.ts +0 -29
- package/lib/event/handler/message.js +0 -307
- package/lib/event/handler/notice.d.ts +0 -18
- package/lib/event/handler/notice.js +0 -214
- package/lib/event/handler/request.d.ts +0 -18
- package/lib/event/handler/request.js +0 -115
- package/lib/event/handler/review.d.ts +0 -55
- package/lib/event/handler/review.js +0 -386
- package/lib/event/index.d.ts +0 -5
- package/lib/event/index.js +0 -5
- package/lib/index.d.ts +0 -8
- package/lib/index.js +0 -8
- package/lib/modules/art-template.d.ts +0 -1
- package/lib/modules/axios.d.ts +0 -2
- package/lib/modules/chalk.d.ts +0 -2
- package/lib/modules/chokidar.d.ts +0 -2
- package/lib/modules/commander.d.ts +0 -2
- package/lib/modules/commander.js +0 -2
- package/lib/modules/express.d.ts +0 -3
- package/lib/modules/express.js +0 -3
- package/lib/modules/level.d.ts +0 -2
- package/lib/modules/lodash.d.ts +0 -1
- package/lib/modules/log4js.d.ts +0 -2
- package/lib/modules/moment.d.ts +0 -1
- package/lib/modules/node-schedule.d.ts +0 -2
- package/lib/modules/redis.d.ts +0 -2
- package/lib/modules/ws.d.ts +0 -3
- package/lib/modules/ws.js +0 -3
- package/lib/modules/yaml.d.ts +0 -2
- package/lib/modules.d.ts +0 -15
- package/lib/modules.js +0 -15
- package/lib/render/app.d.ts +0 -56
- package/lib/render/app.js +0 -120
- package/lib/render/base.d.ts +0 -30
- package/lib/render/base.js +0 -69
- package/lib/render/client.d.ts +0 -41
- package/lib/render/client.js +0 -238
- package/lib/render/http.d.ts +0 -19
- package/lib/render/http.js +0 -50
- package/lib/render/index.d.ts +0 -6
- package/lib/render/index.js +0 -6
- package/lib/render/server.d.ts +0 -25
- package/lib/render/server.js +0 -101
- package/lib/render/wormhole.d.ts +0 -1
- package/lib/render/wormhole.js +0 -156
- package/lib/types/adapter/api.d.ts +0 -399
- package/lib/types/adapter/api.js +0 -1
- package/lib/types/adapter/base.d.ts +0 -560
- package/lib/types/adapter/base.js +0 -1
- package/lib/types/config/config.d.ts +0 -379
- package/lib/types/config/config.js +0 -1
- package/lib/types/element/element.d.ts +0 -565
- package/lib/types/element/element.js +0 -1
- package/lib/types/element/qqbot.d.ts +0 -123
- package/lib/types/element/qqbot.js +0 -1
- package/lib/types/event/contact.d.ts +0 -28
- package/lib/types/event/contact.js +0 -1
- package/lib/types/event/event.d.ts +0 -305
- package/lib/types/event/event.js +0 -1
- package/lib/types/event/index.d.ts +0 -12
- package/lib/types/event/index.js +0 -7
- package/lib/types/event/message.d.ts +0 -109
- package/lib/types/event/message.js +0 -74
- package/lib/types/event/notice.d.ts +0 -513
- package/lib/types/event/notice.js +0 -52
- package/lib/types/event/reply.d.ts +0 -50
- package/lib/types/event/reply.js +0 -1
- package/lib/types/event/request.d.ts +0 -126
- package/lib/types/event/request.js +0 -52
- package/lib/types/event/sender.d.ts +0 -44
- package/lib/types/event/sender.js +0 -1
- package/lib/types/index.d.ts +0 -13
- package/lib/types/index.js +0 -13
- package/lib/types/logger/logger.d.ts +0 -110
- package/lib/types/logger/logger.js +0 -1
- package/lib/types/onebot11/api.d.ts +0 -53
- package/lib/types/onebot11/api.js +0 -1
- package/lib/types/onebot11/event.d.ts +0 -619
- package/lib/types/onebot11/event.js +0 -2
- package/lib/types/onebot11/index.d.ts +0 -6
- package/lib/types/onebot11/index.js +0 -6
- package/lib/types/onebot11/params.d.ts +0 -609
- package/lib/types/onebot11/params.js +0 -1
- package/lib/types/onebot11/response.d.ts +0 -516
- package/lib/types/onebot11/response.js +0 -1
- package/lib/types/onebot11/segment.d.ts +0 -269
- package/lib/types/onebot11/segment.js +0 -1
- package/lib/types/onebot11/sender.d.ts +0 -59
- package/lib/types/onebot11/sender.js +0 -1
- package/lib/types/plugin/app.d.ts +0 -71
- package/lib/types/plugin/app.js +0 -1
- package/lib/types/plugin/plugin.d.ts +0 -473
- package/lib/types/plugin/plugin.js +0 -1
- package/lib/types/render/render.d.ts +0 -118
- package/lib/types/render/render.js +0 -1
- package/lib/types/type/global.d.ts +0 -25
- package/lib/types/type/global.js +0 -1
- package/lib/utils/common/common.d.ts +0 -236
- package/lib/utils/common/common.js +0 -708
- package/lib/utils/config/config.d.ts +0 -193
- package/lib/utils/config/config.js +0 -328
- package/lib/utils/config/updateVersion.d.ts +0 -33
- package/lib/utils/config/updateVersion.js +0 -145
- package/lib/utils/config/yamlEditor.d.ts +0 -101
- package/lib/utils/config/yamlEditor.js +0 -330
- package/lib/utils/core/handler.d.ts +0 -18
- package/lib/utils/core/handler.js +0 -46
- package/lib/utils/core/logger.d.ts +0 -3
- package/lib/utils/core/logger.js +0 -105
- package/lib/utils/core/segment.d.ts +0 -279
- package/lib/utils/core/segment.js +0 -451
- package/lib/utils/index.d.ts +0 -13
- package/lib/utils/index.js +0 -13
- package/lib/utils/tools/button.d.ts +0 -2
- package/lib/utils/tools/button.js +0 -27
- package/lib/utils/tools/exec.d.ts +0 -20
- package/lib/utils/tools/exec.js +0 -54
- package/lib/utils/tools/ffmpeg.d.ts +0 -12
- package/lib/utils/tools/ffmpeg.js +0 -25
- package/lib/utils/tools/restart.d.ts +0 -15
- package/lib/utils/tools/restart.js +0 -39
- package/lib/utils/tools/stop.d.ts +0 -7
- package/lib/utils/tools/stop.js +0 -13
- package/lib/utils/tools/update.d.ts +0 -67
- package/lib/utils/tools/update.js +0 -151
- /package/{config → default}/view/App.yaml +0 -0
- /package/{config → default}/view/config.yaml +0 -0
- /package/{config → default}/view/pm2.yaml +0 -0
- /package/{config → default}/view/redis.yaml +0 -0
- /package/{config → default}/view/server.yaml +0 -0
- /package/{lib/modules → dist/module}/art-template.js +0 -0
- /package/{lib/modules → dist/module}/axios.js +0 -0
- /package/{lib/modules → dist/module}/chalk.js +0 -0
- /package/{lib/modules → dist/module}/chokidar.js +0 -0
- /package/{lib/modules → dist/module}/level.js +0 -0
- /package/{lib/modules → dist/module}/lodash.js +0 -0
- /package/{lib/modules → dist/module}/log4js.js +0 -0
- /package/{lib/modules → dist/module}/moment.js +0 -0
- /package/{lib/modules → dist/module}/node-schedule.js +0 -0
- /package/{lib/modules → dist/module}/redis.js +0 -0
- /package/{lib/modules → dist/module}/yaml.js +0 -0
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
import { KarinEventType, BaseEventDataType, EventType, NoticeSubType } from './event.js';
|
|
2
|
-
/**
|
|
3
|
-
* - 私聊戳一戳
|
|
4
|
-
*/
|
|
5
|
-
export interface PrivatePokeType {
|
|
6
|
-
/**
|
|
7
|
-
* - 操作者uid
|
|
8
|
-
*/
|
|
9
|
-
operator_uid: string;
|
|
10
|
-
/**
|
|
11
|
-
* - 操作者uin
|
|
12
|
-
*/
|
|
13
|
-
operator_uin: string;
|
|
14
|
-
/**
|
|
15
|
-
* - 操作名称,如“戳了戳”
|
|
16
|
-
*/
|
|
17
|
-
action: string;
|
|
18
|
-
/**
|
|
19
|
-
* - 后缀,未设置则未空字符串
|
|
20
|
-
*/
|
|
21
|
-
suffix: string;
|
|
22
|
-
/**
|
|
23
|
-
* - 操作图标url
|
|
24
|
-
*/
|
|
25
|
-
action_image: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* - 私聊撤回消息
|
|
29
|
-
*/
|
|
30
|
-
export interface PrivateRecallType {
|
|
31
|
-
/**
|
|
32
|
-
* - 操作者uid
|
|
33
|
-
*/
|
|
34
|
-
operator_uid: string;
|
|
35
|
-
/**
|
|
36
|
-
* - 操作者uin
|
|
37
|
-
*/
|
|
38
|
-
operator_uin: string;
|
|
39
|
-
/**
|
|
40
|
-
* - 撤回的消息id
|
|
41
|
-
*/
|
|
42
|
-
message_id: string;
|
|
43
|
-
/**
|
|
44
|
-
* - 操作名称,如“撤回了一条消息” 一般此项为空字符串
|
|
45
|
-
*/
|
|
46
|
-
tip_text: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* - 私聊文件上传
|
|
50
|
-
* - 文件信息最少需要提供一个url
|
|
51
|
-
*/
|
|
52
|
-
export interface PrivateFileUploadedType {
|
|
53
|
-
/**
|
|
54
|
-
* - 操作者uid
|
|
55
|
-
*/
|
|
56
|
-
operator_uid: string;
|
|
57
|
-
/**
|
|
58
|
-
* - 操作者uin
|
|
59
|
-
*/
|
|
60
|
-
operator_uin: string;
|
|
61
|
-
/**
|
|
62
|
-
* - 文件ID 此项没有则为空字符串
|
|
63
|
-
*/
|
|
64
|
-
file_id: string;
|
|
65
|
-
/**
|
|
66
|
-
* - 文件子ID 此项没有则为空字符串
|
|
67
|
-
*/
|
|
68
|
-
file_sub_id: number;
|
|
69
|
-
/**
|
|
70
|
-
* - 文件名 此项没有则为空字符串
|
|
71
|
-
*/
|
|
72
|
-
file_name: string;
|
|
73
|
-
/**
|
|
74
|
-
* - 文件大小 此项没有则为0
|
|
75
|
-
*/
|
|
76
|
-
file_size: number;
|
|
77
|
-
/**
|
|
78
|
-
* - 过期时间 此项没有则为0
|
|
79
|
-
*/
|
|
80
|
-
expire_time: number;
|
|
81
|
-
/**
|
|
82
|
-
* - 文件URL
|
|
83
|
-
*/
|
|
84
|
-
file_url: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* - 群聊戳一戳
|
|
88
|
-
*/
|
|
89
|
-
export interface GroupPokeType {
|
|
90
|
-
/**
|
|
91
|
-
* - 操作者uid
|
|
92
|
-
*/
|
|
93
|
-
operator_uid: string;
|
|
94
|
-
/**
|
|
95
|
-
* - 操作者uin
|
|
96
|
-
*/
|
|
97
|
-
operator_uin: string;
|
|
98
|
-
/**
|
|
99
|
-
* - 目标uid 一般为被戳的uid
|
|
100
|
-
*/
|
|
101
|
-
target_uid: string;
|
|
102
|
-
/**
|
|
103
|
-
* - 目标uin 一般为被戳的uin
|
|
104
|
-
*/
|
|
105
|
-
target_uin: string;
|
|
106
|
-
/**
|
|
107
|
-
* - 操作名称,如“戳了戳”
|
|
108
|
-
*/
|
|
109
|
-
action: string;
|
|
110
|
-
/**
|
|
111
|
-
* - 后缀,未设置则未空字符串
|
|
112
|
-
*/
|
|
113
|
-
suffix: string;
|
|
114
|
-
/**
|
|
115
|
-
* - 操作图标url
|
|
116
|
-
*/
|
|
117
|
-
action_image: string;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* - 群聊撤回
|
|
121
|
-
* - 撤回自己消息时,operator和target为自己
|
|
122
|
-
* - 撤回别人消息时,operator为操作者,target为被撤回者
|
|
123
|
-
*/
|
|
124
|
-
export interface GroupRecallType {
|
|
125
|
-
/**
|
|
126
|
-
* - 操作者uid
|
|
127
|
-
*/
|
|
128
|
-
operator_uid: string;
|
|
129
|
-
/**
|
|
130
|
-
* - 操作者uin
|
|
131
|
-
*/
|
|
132
|
-
operator_uin: string;
|
|
133
|
-
/**
|
|
134
|
-
* - 目标uid
|
|
135
|
-
*/
|
|
136
|
-
target_uid: string;
|
|
137
|
-
/**
|
|
138
|
-
* - 目标uin
|
|
139
|
-
*/
|
|
140
|
-
target_uin: string;
|
|
141
|
-
/**
|
|
142
|
-
* - 撤回的消息id
|
|
143
|
-
*/
|
|
144
|
-
message_id: string;
|
|
145
|
-
/**
|
|
146
|
-
* - 操作名称,如“撤回了一条消息” 一般此项为空字符串
|
|
147
|
-
*/
|
|
148
|
-
tip_text: string;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* - 群文件上传
|
|
152
|
-
* - 文件信息最少需要提供一个url
|
|
153
|
-
*/
|
|
154
|
-
export interface GroupFileUploadedType {
|
|
155
|
-
/**
|
|
156
|
-
* - 操作者uid
|
|
157
|
-
*/
|
|
158
|
-
operator_uid: string;
|
|
159
|
-
/**
|
|
160
|
-
* - 操作者uin
|
|
161
|
-
*/
|
|
162
|
-
operator_uin: string;
|
|
163
|
-
/**
|
|
164
|
-
* - 文件ID 此项没有则为空字符串
|
|
165
|
-
*/
|
|
166
|
-
file_id: string;
|
|
167
|
-
/**
|
|
168
|
-
* - 文件子ID 此项没有则为0
|
|
169
|
-
*/
|
|
170
|
-
file_sub_id: number;
|
|
171
|
-
/**
|
|
172
|
-
* - 文件名 此项没有则为空字符串
|
|
173
|
-
*/
|
|
174
|
-
file_name: string;
|
|
175
|
-
/**
|
|
176
|
-
* - 文件大小 此项没有则为0
|
|
177
|
-
*/
|
|
178
|
-
file_size: number;
|
|
179
|
-
/**
|
|
180
|
-
* - 过期时间 此项没有则为0
|
|
181
|
-
*/
|
|
182
|
-
expire_time: number;
|
|
183
|
-
/**
|
|
184
|
-
* - 文件URL
|
|
185
|
-
*/
|
|
186
|
-
file_url: string;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* - 群名片变动
|
|
190
|
-
*/
|
|
191
|
-
export interface GroupCardChangedType {
|
|
192
|
-
/**
|
|
193
|
-
* - 操作者uid
|
|
194
|
-
*/
|
|
195
|
-
operator_uid: string;
|
|
196
|
-
/**
|
|
197
|
-
* - 操作者uin
|
|
198
|
-
*/
|
|
199
|
-
operator_uin: string;
|
|
200
|
-
/**
|
|
201
|
-
* - 目标uid
|
|
202
|
-
*/
|
|
203
|
-
target_uid: string;
|
|
204
|
-
/**
|
|
205
|
-
* - 目标uin
|
|
206
|
-
*/
|
|
207
|
-
target_uin: string;
|
|
208
|
-
/**
|
|
209
|
-
* - 新名片
|
|
210
|
-
*/
|
|
211
|
-
new_card: string;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* - 群成员头衔变动
|
|
215
|
-
*/
|
|
216
|
-
export interface GroupMemberUniqueTitleChangedType {
|
|
217
|
-
/**
|
|
218
|
-
* - 目标uid
|
|
219
|
-
*/
|
|
220
|
-
target_uid: string;
|
|
221
|
-
/**
|
|
222
|
-
* - 目标uin
|
|
223
|
-
*/
|
|
224
|
-
target_uin: string;
|
|
225
|
-
/**
|
|
226
|
-
* - 新头衔
|
|
227
|
-
*/
|
|
228
|
-
title: string;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* - 群精华消息变动
|
|
232
|
-
*/
|
|
233
|
-
export interface GroupEssenceChangedType {
|
|
234
|
-
/**
|
|
235
|
-
* - 群ID
|
|
236
|
-
*/
|
|
237
|
-
group_id: string;
|
|
238
|
-
/**
|
|
239
|
-
* - 操作者uid
|
|
240
|
-
*/
|
|
241
|
-
operator_uid: string;
|
|
242
|
-
/**
|
|
243
|
-
* - 操作者uin
|
|
244
|
-
*/
|
|
245
|
-
operator_uin: string;
|
|
246
|
-
/**
|
|
247
|
-
* - 目标uid
|
|
248
|
-
*/
|
|
249
|
-
target_uid: string;
|
|
250
|
-
/**
|
|
251
|
-
* - 目标uin
|
|
252
|
-
*/
|
|
253
|
-
target_uin: string;
|
|
254
|
-
/**
|
|
255
|
-
* - 被操作的消息id
|
|
256
|
-
*/
|
|
257
|
-
message_id: string;
|
|
258
|
-
/**
|
|
259
|
-
* - 设置、取消精华
|
|
260
|
-
*/
|
|
261
|
-
is_set: boolean;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* - 群成员增加
|
|
265
|
-
*/
|
|
266
|
-
export interface GroupMemberIncreaseType {
|
|
267
|
-
/**
|
|
268
|
-
* - 群ID
|
|
269
|
-
*/
|
|
270
|
-
group_id: string;
|
|
271
|
-
/**
|
|
272
|
-
* - 操作者uid
|
|
273
|
-
*/
|
|
274
|
-
operator_uid: string;
|
|
275
|
-
/**
|
|
276
|
-
* - 操作者uin
|
|
277
|
-
*/
|
|
278
|
-
operator_uin: string;
|
|
279
|
-
/**
|
|
280
|
-
* - 目标uid
|
|
281
|
-
*/
|
|
282
|
-
target_uid: string;
|
|
283
|
-
/**
|
|
284
|
-
* - 目标uin
|
|
285
|
-
*/
|
|
286
|
-
target_uin: string;
|
|
287
|
-
/**
|
|
288
|
-
* - 加入方式 APPROVE:管理员批准 INVITE:管理员邀请
|
|
289
|
-
*/
|
|
290
|
-
type: 'invite' | 'approve';
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* - 群成员减少
|
|
294
|
-
*/
|
|
295
|
-
export interface GroupMemberDecreaseType {
|
|
296
|
-
/**
|
|
297
|
-
* - 群ID
|
|
298
|
-
*/
|
|
299
|
-
group_id: string;
|
|
300
|
-
/**
|
|
301
|
-
* - 操作者uid
|
|
302
|
-
*/
|
|
303
|
-
operator_uid: string;
|
|
304
|
-
/**
|
|
305
|
-
* - 操作者uin
|
|
306
|
-
*/
|
|
307
|
-
operator_uin: string;
|
|
308
|
-
/**
|
|
309
|
-
* - 目标uid
|
|
310
|
-
*/
|
|
311
|
-
target_uid: string;
|
|
312
|
-
/**
|
|
313
|
-
* - 目标uin
|
|
314
|
-
*/
|
|
315
|
-
target_uin: string;
|
|
316
|
-
/**
|
|
317
|
-
* - 减少方式 leave:主动退群 kick:成员被踢 kick_me:机器人自身被踢
|
|
318
|
-
*/
|
|
319
|
-
type: 'leave' | 'kick' | 'kick_me';
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* - 群管理员变动
|
|
323
|
-
*/
|
|
324
|
-
export interface GroupAdminChangedType {
|
|
325
|
-
/**
|
|
326
|
-
* - 群ID
|
|
327
|
-
*/
|
|
328
|
-
group_id: string;
|
|
329
|
-
/**
|
|
330
|
-
* - 目标uid
|
|
331
|
-
*/
|
|
332
|
-
target_uid: string;
|
|
333
|
-
/**
|
|
334
|
-
* - 目标uin
|
|
335
|
-
*/
|
|
336
|
-
target_uin: string;
|
|
337
|
-
/**
|
|
338
|
-
* - 设置、取消管理员
|
|
339
|
-
*/
|
|
340
|
-
is_admin: boolean;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* - 群打卡
|
|
344
|
-
*/
|
|
345
|
-
export interface GroupSignInType {
|
|
346
|
-
/**
|
|
347
|
-
* - 群ID
|
|
348
|
-
*/
|
|
349
|
-
group_id: string;
|
|
350
|
-
/**
|
|
351
|
-
* - 目标uid
|
|
352
|
-
*/
|
|
353
|
-
target_uid: string;
|
|
354
|
-
/**
|
|
355
|
-
* - 目标uin
|
|
356
|
-
*/
|
|
357
|
-
target_uin: string;
|
|
358
|
-
/**
|
|
359
|
-
* - 操作名称,如“打卡了”
|
|
360
|
-
*/
|
|
361
|
-
action: string;
|
|
362
|
-
/**
|
|
363
|
-
* - 打卡图标url
|
|
364
|
-
*/
|
|
365
|
-
rank_image: string;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* - 群成员被禁言
|
|
369
|
-
*/
|
|
370
|
-
export interface GroupMemberBanType {
|
|
371
|
-
/**
|
|
372
|
-
* - 群ID
|
|
373
|
-
*/
|
|
374
|
-
group_id: string;
|
|
375
|
-
/**
|
|
376
|
-
* - 操作者uid
|
|
377
|
-
*/
|
|
378
|
-
operator_uid: string;
|
|
379
|
-
/**
|
|
380
|
-
* - 操作者uin
|
|
381
|
-
*/
|
|
382
|
-
operator_uin: string;
|
|
383
|
-
/**
|
|
384
|
-
* - 目标uid
|
|
385
|
-
*/
|
|
386
|
-
target_uid: string;
|
|
387
|
-
/**
|
|
388
|
-
* - 目标uin
|
|
389
|
-
*/
|
|
390
|
-
target_uin: string;
|
|
391
|
-
/**
|
|
392
|
-
* - 禁言时长,单位秒
|
|
393
|
-
*/
|
|
394
|
-
duration: number;
|
|
395
|
-
/**
|
|
396
|
-
* - 禁言类型 ban:禁言 lift_ban:解禁
|
|
397
|
-
*/
|
|
398
|
-
type: 'ban' | 'lift_ban';
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* - 群全员禁言
|
|
402
|
-
*/
|
|
403
|
-
export interface GroupWholeBanType {
|
|
404
|
-
/**
|
|
405
|
-
* - 群ID
|
|
406
|
-
*/
|
|
407
|
-
group_id: string;
|
|
408
|
-
/**
|
|
409
|
-
* - 操作者uid
|
|
410
|
-
*/
|
|
411
|
-
operator_uid: string;
|
|
412
|
-
/**
|
|
413
|
-
* - 操作者uin
|
|
414
|
-
*/
|
|
415
|
-
operator_uin: string;
|
|
416
|
-
/**
|
|
417
|
-
* - 是否开启全体禁言
|
|
418
|
-
*/
|
|
419
|
-
is_ban: boolean;
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* - 群表情动态
|
|
423
|
-
*/
|
|
424
|
-
export interface GroupMessageReactionType {
|
|
425
|
-
/**
|
|
426
|
-
* - 群ID
|
|
427
|
-
*/
|
|
428
|
-
group_id: string;
|
|
429
|
-
/**
|
|
430
|
-
* - 操作者uid
|
|
431
|
-
*/
|
|
432
|
-
message_id: string;
|
|
433
|
-
/**
|
|
434
|
-
* - 表情ID 参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType
|
|
435
|
-
*/
|
|
436
|
-
face_id: number;
|
|
437
|
-
/**
|
|
438
|
-
* - 添加、取消回应
|
|
439
|
-
*/
|
|
440
|
-
is_set: boolean;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* - 通知事件子类型
|
|
444
|
-
*/
|
|
445
|
-
export interface NoticeType {
|
|
446
|
-
[NoticeSubType.PrivatePoke]: PrivatePokeType;
|
|
447
|
-
[NoticeSubType.PrivateRecall]: PrivateRecallType;
|
|
448
|
-
[NoticeSubType.PrivateFileUploaded]: PrivateFileUploadedType;
|
|
449
|
-
[NoticeSubType.GroupPoke]: GroupPokeType;
|
|
450
|
-
[NoticeSubType.GroupRecall]: GroupRecallType;
|
|
451
|
-
[NoticeSubType.GroupFileUploaded]: GroupFileUploadedType;
|
|
452
|
-
[NoticeSubType.GroupCardChanged]: GroupCardChangedType;
|
|
453
|
-
[NoticeSubType.GroupMemberUniqueTitleChanged]: GroupMemberUniqueTitleChangedType;
|
|
454
|
-
[NoticeSubType.GroupEssenceChanged]: GroupEssenceChangedType;
|
|
455
|
-
[NoticeSubType.GroupMemberIncrease]: GroupMemberIncreaseType;
|
|
456
|
-
[NoticeSubType.GroupMemberDecrease]: GroupMemberDecreaseType;
|
|
457
|
-
[NoticeSubType.GroupAdminChanged]: GroupAdminChangedType;
|
|
458
|
-
[NoticeSubType.GroupSignIn]: GroupSignInType;
|
|
459
|
-
[NoticeSubType.GroupMemberBan]: GroupMemberBanType;
|
|
460
|
-
[NoticeSubType.GroupWholeBan]: GroupWholeBanType;
|
|
461
|
-
[NoticeSubType.GroupMessageReaction]: GroupMessageReactionType;
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* - 请求事件基类
|
|
465
|
-
*/
|
|
466
|
-
export interface KarinNoticeEventBase extends KarinEventType {
|
|
467
|
-
event: EventType.Notice;
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* - 辅助类型,用于生成 KarinRequestEvent 的联合类型来自动推导content的类型
|
|
471
|
-
*/
|
|
472
|
-
type NoticeEvent<T extends NoticeSubType> = KarinNoticeEventBase & {
|
|
473
|
-
sub_event: T;
|
|
474
|
-
content: NoticeType[T];
|
|
475
|
-
};
|
|
476
|
-
/**
|
|
477
|
-
* - 通知事件定义
|
|
478
|
-
*/
|
|
479
|
-
export type KarinNoticeType = NoticeEvent<NoticeSubType.PrivatePoke> | NoticeEvent<NoticeSubType.PrivateRecall> | NoticeEvent<NoticeSubType.PrivateFileUploaded> | NoticeEvent<NoticeSubType.GroupPoke> | NoticeEvent<NoticeSubType.GroupRecall> | NoticeEvent<NoticeSubType.GroupFileUploaded> | NoticeEvent<NoticeSubType.GroupCardChanged> | NoticeEvent<NoticeSubType.GroupMemberUniqueTitleChanged> | NoticeEvent<NoticeSubType.GroupEssenceChanged> | NoticeEvent<NoticeSubType.GroupMemberIncrease> | NoticeEvent<NoticeSubType.GroupMemberDecrease> | NoticeEvent<NoticeSubType.GroupAdminChanged> | NoticeEvent<NoticeSubType.GroupSignIn> | NoticeEvent<NoticeSubType.GroupMemberBan> | NoticeEvent<NoticeSubType.GroupWholeBan> | NoticeEvent<NoticeSubType.GroupMessageReaction>;
|
|
480
|
-
/**
|
|
481
|
-
* - 创建一个通知事件
|
|
482
|
-
*/
|
|
483
|
-
export declare class KarinNotice implements KarinNoticeEventBase {
|
|
484
|
-
self_id: KarinNoticeType['self_id'];
|
|
485
|
-
user_id: KarinNoticeType['user_id'];
|
|
486
|
-
group_id: KarinNoticeType['group_id'];
|
|
487
|
-
event: KarinNoticeType['event'];
|
|
488
|
-
sub_event: KarinNoticeType['sub_event'];
|
|
489
|
-
event_id: KarinNoticeType['event_id'];
|
|
490
|
-
time: KarinNoticeType['time'];
|
|
491
|
-
contact: KarinNoticeType['contact'];
|
|
492
|
-
sender: KarinNoticeType['sender'];
|
|
493
|
-
isMaster: KarinNoticeType['isMaster'];
|
|
494
|
-
isAdmin: KarinNoticeType['isAdmin'];
|
|
495
|
-
isPrivate: KarinNoticeType['isPrivate'];
|
|
496
|
-
isGroup: KarinNoticeType['isGroup'];
|
|
497
|
-
isGuild: KarinNoticeType['isGuild'];
|
|
498
|
-
isGroupTemp: KarinNoticeType['isGroupTemp'];
|
|
499
|
-
logFnc: KarinNoticeType['logFnc'];
|
|
500
|
-
logText: KarinNoticeType['logText'];
|
|
501
|
-
store: KarinNoticeType['store'];
|
|
502
|
-
raw_message: KarinNoticeType['raw_message'];
|
|
503
|
-
raw_event: KarinNoticeType['raw_event'];
|
|
504
|
-
reply: KarinNoticeType['reply'];
|
|
505
|
-
replyCallback: KarinNoticeType['replyCallback'];
|
|
506
|
-
bot: KarinNoticeType['bot'];
|
|
507
|
-
content: KarinNoticeType['content'];
|
|
508
|
-
constructor({ event_id, self_id, user_id, group_id, time, contact, sender, sub_event, content, raw_event, }: BaseEventDataType & {
|
|
509
|
-
sub_event: KarinNoticeType['sub_event'];
|
|
510
|
-
content: KarinNoticeType['content'];
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* - 创建一个通知事件
|
|
3
|
-
*/
|
|
4
|
-
export class KarinNotice {
|
|
5
|
-
self_id;
|
|
6
|
-
user_id;
|
|
7
|
-
group_id;
|
|
8
|
-
event;
|
|
9
|
-
sub_event;
|
|
10
|
-
event_id;
|
|
11
|
-
time;
|
|
12
|
-
contact;
|
|
13
|
-
sender;
|
|
14
|
-
isMaster;
|
|
15
|
-
isAdmin;
|
|
16
|
-
isPrivate;
|
|
17
|
-
isGroup;
|
|
18
|
-
isGuild;
|
|
19
|
-
isGroupTemp;
|
|
20
|
-
logFnc;
|
|
21
|
-
logText;
|
|
22
|
-
store;
|
|
23
|
-
raw_message;
|
|
24
|
-
raw_event;
|
|
25
|
-
reply;
|
|
26
|
-
replyCallback;
|
|
27
|
-
bot;
|
|
28
|
-
content;
|
|
29
|
-
constructor({ event_id, self_id, user_id, group_id = '', time, contact, sender, sub_event, content, raw_event, }) {
|
|
30
|
-
this.raw_event = raw_event;
|
|
31
|
-
this.self_id = self_id;
|
|
32
|
-
this.user_id = user_id;
|
|
33
|
-
this.group_id = contact.scene === 'group' ? (contact.peer || group_id) : group_id;
|
|
34
|
-
this.time = time;
|
|
35
|
-
this.event = "notice" /* EventType.Notice */;
|
|
36
|
-
this.event_id = event_id;
|
|
37
|
-
this.contact = contact;
|
|
38
|
-
this.sender = sender;
|
|
39
|
-
this.sub_event = sub_event;
|
|
40
|
-
this.isMaster = false;
|
|
41
|
-
this.isAdmin = false;
|
|
42
|
-
this.isPrivate = false;
|
|
43
|
-
this.isGroup = false;
|
|
44
|
-
this.isGuild = false;
|
|
45
|
-
this.isGroupTemp = false;
|
|
46
|
-
this.logFnc = '';
|
|
47
|
-
this.logText = '';
|
|
48
|
-
this.store = new Map();
|
|
49
|
-
this.raw_message = '';
|
|
50
|
-
this.content = content;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { KarinElement, NodeElement } from '../element/element.js';
|
|
2
|
-
export type Reply = (
|
|
3
|
-
/**
|
|
4
|
-
* 发送的消息
|
|
5
|
-
*/
|
|
6
|
-
elements: string | KarinElement | Array<KarinElement | string>,
|
|
7
|
-
/**
|
|
8
|
-
* 选项
|
|
9
|
-
*/
|
|
10
|
-
options?: {
|
|
11
|
-
/**
|
|
12
|
-
* 是否@回复
|
|
13
|
-
*/
|
|
14
|
-
at?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 是否回复
|
|
17
|
-
*/
|
|
18
|
-
reply?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 发送成功后撤回发送消息的时间
|
|
21
|
-
*/
|
|
22
|
-
recallMsg?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 重试次数
|
|
25
|
-
*/
|
|
26
|
-
retry_count?: number;
|
|
27
|
-
}) => Promise<ReplyReturn>;
|
|
28
|
-
/**
|
|
29
|
-
* 发送消息后返回信息
|
|
30
|
-
*/
|
|
31
|
-
export interface ReplyReturn {
|
|
32
|
-
/**
|
|
33
|
-
* 消息ID
|
|
34
|
-
*/
|
|
35
|
-
message_id: string;
|
|
36
|
-
/** 消息发送时间戳 */
|
|
37
|
-
message_time?: number;
|
|
38
|
-
/** 原始结果 QQBot适配器下为数组 */
|
|
39
|
-
raw_data?: any;
|
|
40
|
-
}
|
|
41
|
-
export type replyCallback = (
|
|
42
|
-
/**
|
|
43
|
-
* 发送的消息
|
|
44
|
-
*/
|
|
45
|
-
elements: KarinElement[],
|
|
46
|
-
/**
|
|
47
|
-
* 重试次数
|
|
48
|
-
*/
|
|
49
|
-
retry_count?: number) => Promise<ReplyReturn>;
|
|
50
|
-
export type replyForward = (msg: NodeElement[]) => Promise<ReplyReturn>;
|
package/lib/types/event/reply.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|