node-karin 0.12.1 → 0.12.2-5.pr.206.02ba956

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.
Files changed (256) hide show
  1. package/CHANGELOG.md +1029 -0
  2. package/default/comment/config.json +34 -0
  3. package/default/comment/friendDirect.json +10 -0
  4. package/default/comment/groupGuild.json +11 -0
  5. package/default/comment/server.json +17 -0
  6. package/default/config/adapter.json +28 -0
  7. package/default/config/config.json +45 -0
  8. package/default/config/groups.json +47 -0
  9. package/default/config/groups.yaml +70 -0
  10. package/default/config/pm2.json +16 -0
  11. package/default/config/privates.json +23 -0
  12. package/default/config/privates.yaml +31 -0
  13. package/default/config/redis.json +10 -0
  14. package/default/config/render.json +19 -0
  15. package/default/view/group.yaml +73 -0
  16. package/dist/cli/index.cjs +526 -0
  17. package/{lib/cli/init.d.ts → dist/cli/index.d.ts} +0 -1
  18. package/dist/cli/index.js +517 -0
  19. package/dist/index.d.ts +9869 -0
  20. package/dist/index.js +12651 -0
  21. package/dist/module/art-template.cjs +11 -0
  22. package/dist/module/art-template.d.ts +1 -0
  23. package/dist/module/axios.cjs +22 -0
  24. package/dist/module/axios.d.ts +2 -0
  25. package/dist/module/chalk.cjs +22 -0
  26. package/dist/module/chalk.d.ts +2 -0
  27. package/dist/module/chokidar.cjs +22 -0
  28. package/dist/module/chokidar.d.ts +2 -0
  29. package/dist/module/commander.cjs +35 -0
  30. package/dist/module/commander.d.ts +3 -0
  31. package/dist/module/commander.js +3 -0
  32. package/dist/module/dotenv.cjs +22 -0
  33. package/dist/module/dotenv.d.ts +2 -0
  34. package/dist/module/dotenv.js +2 -0
  35. package/dist/module/express.cjs +32 -0
  36. package/dist/module/express.d.ts +1 -0
  37. package/dist/module/express.js +1 -0
  38. package/dist/module/level.cjs +22 -0
  39. package/dist/module/level.d.ts +2 -0
  40. package/dist/module/lodash.cjs +11 -0
  41. package/dist/module/lodash.d.ts +1 -0
  42. package/dist/module/log4js.cjs +22 -0
  43. package/dist/module/log4js.d.ts +2 -0
  44. package/dist/module/moment.cjs +11 -0
  45. package/dist/module/moment.d.ts +1 -0
  46. package/dist/module/node-schedule.cjs +22 -0
  47. package/dist/module/node-schedule.d.ts +2 -0
  48. package/dist/module/redis.cjs +22 -0
  49. package/dist/module/redis.d.ts +2 -0
  50. package/dist/module/ws.cjs +28 -0
  51. package/dist/module/ws.d.ts +1 -0
  52. package/dist/module/ws.js +1 -0
  53. package/dist/module/yaml.cjs +22 -0
  54. package/dist/module/yaml.d.ts +2 -0
  55. package/dist/root.d.ts +40 -0
  56. package/dist/root.js +44 -0
  57. package/package.json +150 -129
  58. package/LICENSE +0 -674
  59. package/README.md +0 -56
  60. package/config/defSet/App.yaml +0 -42
  61. package/config/defSet/config.yaml +0 -65
  62. package/config/defSet/group.yaml +0 -56
  63. package/config/defSet/pm2.yaml +0 -21
  64. package/config/defSet/redis.yaml +0 -18
  65. package/config/defSet/server.yaml +0 -42
  66. package/config/view/group.yaml +0 -92
  67. package/lib/adapter/index.d.ts +0 -2
  68. package/lib/adapter/index.js +0 -2
  69. package/lib/adapter/input/index.d.ts +0 -78
  70. package/lib/adapter/input/index.js +0 -205
  71. package/lib/adapter/onebot/11/convert.d.ts +0 -12
  72. package/lib/adapter/onebot/11/convert.js +0 -167
  73. package/lib/adapter/onebot/11/event.d.ts +0 -25
  74. package/lib/adapter/onebot/11/event.js +0 -442
  75. package/lib/adapter/onebot/11/index.d.ts +0 -508
  76. package/lib/adapter/onebot/11/index.js +0 -1047
  77. package/lib/cli/index.d.ts +0 -92
  78. package/lib/cli/index.js +0 -307
  79. package/lib/cli/init.js +0 -22
  80. package/lib/cli/karin.d.ts +0 -2
  81. package/lib/cli/karin.js +0 -16
  82. package/lib/cli/pkg.d.ts +0 -4
  83. package/lib/cli/pkg.js +0 -14
  84. package/lib/cli/start.d.ts +0 -1
  85. package/lib/cli/start.js +0 -8
  86. package/lib/core/index.d.ts +0 -10
  87. package/lib/core/index.js +0 -10
  88. package/lib/core/init/config.d.ts +0 -43
  89. package/lib/core/init/config.js +0 -201
  90. package/lib/core/init/dir.d.ts +0 -4
  91. package/lib/core/init/dir.js +0 -7
  92. package/lib/core/init/init.d.ts +0 -1
  93. package/lib/core/init/init.js +0 -47
  94. package/lib/core/karin/karin.d.ts +0 -198
  95. package/lib/core/karin/karin.js +0 -226
  96. package/lib/core/listener/listener.d.ts +0 -145
  97. package/lib/core/listener/listener.js +0 -235
  98. package/lib/core/plugin/base.d.ts +0 -156
  99. package/lib/core/plugin/base.js +0 -131
  100. package/lib/core/plugin/loader.d.ts +0 -141
  101. package/lib/core/plugin/loader.js +0 -618
  102. package/lib/core/process/process.d.ts +0 -18
  103. package/lib/core/process/process.js +0 -96
  104. package/lib/core/server/server.d.ts +0 -25
  105. package/lib/core/server/server.js +0 -295
  106. package/lib/db/index.d.ts +0 -2
  107. package/lib/db/index.js +0 -2
  108. package/lib/db/level/level.d.ts +0 -19
  109. package/lib/db/level/level.js +0 -36
  110. package/lib/db/redis/redis.d.ts +0 -2
  111. package/lib/db/redis/redis.js +0 -135
  112. package/lib/db/redis/redis_level.d.ts +0 -112
  113. package/lib/db/redis/redis_level.js +0 -281
  114. package/lib/event/handler/base.d.ts +0 -42
  115. package/lib/event/handler/base.js +0 -200
  116. package/lib/event/handler/message.d.ts +0 -25
  117. package/lib/event/handler/message.js +0 -302
  118. package/lib/event/handler/notice.d.ts +0 -18
  119. package/lib/event/handler/notice.js +0 -214
  120. package/lib/event/handler/request.d.ts +0 -18
  121. package/lib/event/handler/request.js +0 -115
  122. package/lib/event/handler/review.d.ts +0 -55
  123. package/lib/event/handler/review.js +0 -386
  124. package/lib/event/index.d.ts +0 -5
  125. package/lib/event/index.js +0 -5
  126. package/lib/index.d.ts +0 -8
  127. package/lib/index.js +0 -8
  128. package/lib/modules/art-template.d.ts +0 -1
  129. package/lib/modules/axios.d.ts +0 -2
  130. package/lib/modules/chalk.d.ts +0 -2
  131. package/lib/modules/chokidar.d.ts +0 -2
  132. package/lib/modules/commander.d.ts +0 -2
  133. package/lib/modules/commander.js +0 -2
  134. package/lib/modules/express.d.ts +0 -3
  135. package/lib/modules/express.js +0 -3
  136. package/lib/modules/level.d.ts +0 -2
  137. package/lib/modules/lodash.d.ts +0 -1
  138. package/lib/modules/log4js.d.ts +0 -2
  139. package/lib/modules/moment.d.ts +0 -1
  140. package/lib/modules/node-schedule.d.ts +0 -2
  141. package/lib/modules/redis.d.ts +0 -2
  142. package/lib/modules/ws.d.ts +0 -3
  143. package/lib/modules/ws.js +0 -3
  144. package/lib/modules/yaml.d.ts +0 -2
  145. package/lib/modules.d.ts +0 -15
  146. package/lib/modules.js +0 -15
  147. package/lib/render/app.d.ts +0 -56
  148. package/lib/render/app.js +0 -120
  149. package/lib/render/base.d.ts +0 -30
  150. package/lib/render/base.js +0 -69
  151. package/lib/render/client.d.ts +0 -41
  152. package/lib/render/client.js +0 -238
  153. package/lib/render/http.d.ts +0 -19
  154. package/lib/render/http.js +0 -50
  155. package/lib/render/index.d.ts +0 -6
  156. package/lib/render/index.js +0 -6
  157. package/lib/render/server.d.ts +0 -25
  158. package/lib/render/server.js +0 -101
  159. package/lib/render/wormhole.d.ts +0 -1
  160. package/lib/render/wormhole.js +0 -156
  161. package/lib/types/adapter/api.d.ts +0 -399
  162. package/lib/types/adapter/api.js +0 -1
  163. package/lib/types/adapter/base.d.ts +0 -560
  164. package/lib/types/adapter/base.js +0 -1
  165. package/lib/types/config/config.d.ts +0 -379
  166. package/lib/types/config/config.js +0 -1
  167. package/lib/types/element/element.d.ts +0 -565
  168. package/lib/types/element/element.js +0 -1
  169. package/lib/types/element/qqbot.d.ts +0 -123
  170. package/lib/types/element/qqbot.js +0 -1
  171. package/lib/types/event/contact.d.ts +0 -28
  172. package/lib/types/event/contact.js +0 -1
  173. package/lib/types/event/event.d.ts +0 -305
  174. package/lib/types/event/event.js +0 -1
  175. package/lib/types/event/index.d.ts +0 -12
  176. package/lib/types/event/index.js +0 -7
  177. package/lib/types/event/message.d.ts +0 -109
  178. package/lib/types/event/message.js +0 -74
  179. package/lib/types/event/notice.d.ts +0 -513
  180. package/lib/types/event/notice.js +0 -52
  181. package/lib/types/event/reply.d.ts +0 -50
  182. package/lib/types/event/reply.js +0 -1
  183. package/lib/types/event/request.d.ts +0 -126
  184. package/lib/types/event/request.js +0 -52
  185. package/lib/types/event/sender.d.ts +0 -44
  186. package/lib/types/event/sender.js +0 -1
  187. package/lib/types/index.d.ts +0 -13
  188. package/lib/types/index.js +0 -13
  189. package/lib/types/logger/logger.d.ts +0 -110
  190. package/lib/types/logger/logger.js +0 -1
  191. package/lib/types/onebot11/api.d.ts +0 -53
  192. package/lib/types/onebot11/api.js +0 -1
  193. package/lib/types/onebot11/event.d.ts +0 -619
  194. package/lib/types/onebot11/event.js +0 -2
  195. package/lib/types/onebot11/index.d.ts +0 -6
  196. package/lib/types/onebot11/index.js +0 -6
  197. package/lib/types/onebot11/params.d.ts +0 -609
  198. package/lib/types/onebot11/params.js +0 -1
  199. package/lib/types/onebot11/response.d.ts +0 -516
  200. package/lib/types/onebot11/response.js +0 -1
  201. package/lib/types/onebot11/segment.d.ts +0 -269
  202. package/lib/types/onebot11/segment.js +0 -1
  203. package/lib/types/onebot11/sender.d.ts +0 -59
  204. package/lib/types/onebot11/sender.js +0 -1
  205. package/lib/types/plugin/app.d.ts +0 -71
  206. package/lib/types/plugin/app.js +0 -1
  207. package/lib/types/plugin/plugin.d.ts +0 -473
  208. package/lib/types/plugin/plugin.js +0 -1
  209. package/lib/types/render/render.d.ts +0 -118
  210. package/lib/types/render/render.js +0 -1
  211. package/lib/types/type/global.d.ts +0 -25
  212. package/lib/types/type/global.js +0 -1
  213. package/lib/utils/common/common.d.ts +0 -236
  214. package/lib/utils/common/common.js +0 -708
  215. package/lib/utils/config/config.d.ts +0 -193
  216. package/lib/utils/config/config.js +0 -328
  217. package/lib/utils/config/updateVersion.d.ts +0 -33
  218. package/lib/utils/config/updateVersion.js +0 -145
  219. package/lib/utils/config/yamlEditor.d.ts +0 -101
  220. package/lib/utils/config/yamlEditor.js +0 -330
  221. package/lib/utils/core/handler.d.ts +0 -18
  222. package/lib/utils/core/handler.js +0 -46
  223. package/lib/utils/core/logger.d.ts +0 -3
  224. package/lib/utils/core/logger.js +0 -105
  225. package/lib/utils/core/segment.d.ts +0 -279
  226. package/lib/utils/core/segment.js +0 -451
  227. package/lib/utils/index.d.ts +0 -13
  228. package/lib/utils/index.js +0 -13
  229. package/lib/utils/tools/button.d.ts +0 -2
  230. package/lib/utils/tools/button.js +0 -27
  231. package/lib/utils/tools/exec.d.ts +0 -20
  232. package/lib/utils/tools/exec.js +0 -54
  233. package/lib/utils/tools/ffmpeg.d.ts +0 -12
  234. package/lib/utils/tools/ffmpeg.js +0 -25
  235. package/lib/utils/tools/restart.d.ts +0 -15
  236. package/lib/utils/tools/restart.js +0 -39
  237. package/lib/utils/tools/stop.d.ts +0 -7
  238. package/lib/utils/tools/stop.js +0 -13
  239. package/lib/utils/tools/update.d.ts +0 -67
  240. package/lib/utils/tools/update.js +0 -151
  241. /package/{config → default}/view/App.yaml +0 -0
  242. /package/{config → default}/view/config.yaml +0 -0
  243. /package/{config → default}/view/pm2.yaml +0 -0
  244. /package/{config → default}/view/redis.yaml +0 -0
  245. /package/{config → default}/view/server.yaml +0 -0
  246. /package/{lib/modules → dist/module}/art-template.js +0 -0
  247. /package/{lib/modules → dist/module}/axios.js +0 -0
  248. /package/{lib/modules → dist/module}/chalk.js +0 -0
  249. /package/{lib/modules → dist/module}/chokidar.js +0 -0
  250. /package/{lib/modules → dist/module}/level.js +0 -0
  251. /package/{lib/modules → dist/module}/lodash.js +0 -0
  252. /package/{lib/modules → dist/module}/log4js.js +0 -0
  253. /package/{lib/modules → dist/module}/moment.js +0 -0
  254. /package/{lib/modules → dist/module}/node-schedule.js +0 -0
  255. /package/{lib/modules → dist/module}/redis.js +0 -0
  256. /package/{lib/modules → dist/module}/yaml.js +0 -0
@@ -1,619 +0,0 @@
1
- import { OB11Segment } from './segment.js';
2
- import { GroupSender, PrivateSender, ob11Sender } from './sender.js';
3
- /**
4
- * OneBot11消息类型枚举
5
- */
6
- export declare const enum OB11PostType {
7
- Message = "message",
8
- Notice = "notice",
9
- Request = "request",
10
- MetaEvent = "meta_event",
11
- MessageSent = "message_sent"
12
- }
13
- /**
14
- * 消息事件类型
15
- */
16
- export declare const enum OB11MessageType {
17
- Private = "private",
18
- Group = "group"
19
- }
20
- /**
21
- * 消息子类型
22
- */
23
- export declare const enum OB11MessageSubType {
24
- Friend = "friend",
25
- Group = "group",
26
- Other = "other",
27
- Normal = "normal",
28
- Anonymous = "anonymous",
29
- Notice = "notice"
30
- }
31
- /**
32
- * 消息事件类型映射
33
- */
34
- export interface ob11MessageEventMapp {
35
- [OB11MessageType.Group]: 'normal' | 'anonymous' | 'notice';
36
- [OB11MessageType.Private]: 'friend' | 'group' | 'other';
37
- }
38
- /**
39
- * 消息事件子类型泛型
40
- */
41
- export type OB11MessageToSub<T extends OB11MessageType> = T extends keyof ob11MessageEventMapp ? ob11MessageEventMapp[T] : never;
42
- /**
43
- * - 所有事件基类
44
- */
45
- export interface OB11Event {
46
- /**
47
- * - 事件发生的时间戳
48
- */
49
- time: number;
50
- /**
51
- * - 事件类型
52
- */
53
- post_type: OB11PostType;
54
- /**
55
- * - 收到事件的机器人 QQ 号
56
- */
57
- self_id: string;
58
- }
59
- /**
60
- * - 消息事件基类
61
- */
62
- export interface OB11Message extends OB11Event {
63
- /**
64
- * - 事件类型
65
- */
66
- post_type: OB11PostType.Message | OB11PostType.MessageSent;
67
- /**
68
- * - 消息类型
69
- */
70
- message_type: OB11MessageType[keyof OB11MessageType];
71
- /**
72
- * - 消息子类型
73
- */
74
- sub_type: OB11MessageToSub<OB11MessageType>;
75
- /**
76
- * - 消息 ID
77
- */
78
- message_id: string;
79
- /**
80
- * - 发送者 QQ 号
81
- */
82
- user_id: string;
83
- /**
84
- * - 消息内容
85
- */
86
- message: OB11Segment[];
87
- /**
88
- * - 原始消息内容
89
- */
90
- raw_message: string;
91
- /**
92
- * - 字体
93
- */
94
- font: number;
95
- /**
96
- * - 发送人信息
97
- */
98
- sender: ob11Sender;
99
- }
100
- /**
101
- * - 私聊消息事件
102
- */
103
- export interface OB11PrivateMessage extends OB11Message {
104
- /**
105
- * - 消息类型
106
- */
107
- message_type: 'private';
108
- /**
109
- * - 消息子类型
110
- */
111
- sub_type: 'friend';
112
- /**
113
- * - 发送人信息
114
- */
115
- sender: PrivateSender;
116
- }
117
- /**
118
- * - 群消息事件
119
- */
120
- export interface OB11GroupMessage extends OB11Message {
121
- /**
122
- * - 消息类型
123
- */
124
- message_type: 'group';
125
- /**
126
- * - 消息子类型
127
- */
128
- sub_type: 'normal' | 'anonymous' | 'notice';
129
- /**
130
- * - 群号
131
- */
132
- group_id: string;
133
- /**
134
- * - 匿名信息
135
- */
136
- anonymous?: {
137
- /**
138
- * - 匿名用户 ID
139
- */
140
- id: string;
141
- /**
142
- * - 匿名用户名称
143
- */
144
- name: string;
145
- /**
146
- * - 匿名用户 flag,在调用禁言 API 时需要传入
147
- */
148
- flag: string;
149
- };
150
- sender: GroupSender;
151
- }
152
- /**
153
- * 通知事件类型
154
- */
155
- export declare const enum OB11NoticeType {
156
- GroupUpload = "group_upload",
157
- GroupAdmin = "group_admin",
158
- GroupDecrease = "group_decrease",
159
- GroupIncrease = "group_increase",
160
- GroupBan = "group_ban",
161
- FriendAdd = "friend_add",
162
- GroupRecall = "group_recall",
163
- FriendRecall = "friend_recall",
164
- Notify = "notify",
165
- GroupMsgEmojiLike = "group_msg_emoji_like"
166
- }
167
- /**
168
- * - 通知事件基类
169
- */
170
- export interface OneBot11Notice extends OB11Event {
171
- /**
172
- * - 事件类型
173
- */
174
- post_type: OB11PostType.Notice;
175
- /**
176
- * - 通知类型
177
- */
178
- notice_type: OB11NoticeType;
179
- }
180
- /**
181
- * - 群文件上传事件
182
- */
183
- export interface OneBot11GroupUpload extends OneBot11Notice {
184
- /**
185
- * - 通知类型
186
- */
187
- notice_type: OB11NoticeType.GroupUpload;
188
- /**
189
- * - 群号
190
- */
191
- group_id: string;
192
- /**
193
- * - 发送者 QQ 号
194
- */
195
- user_id: string;
196
- /**
197
- * - 文件信息
198
- */
199
- file: {
200
- /**
201
- * - 文件 ID
202
- */
203
- id: string;
204
- /**
205
- * - 文件名
206
- */
207
- name: string;
208
- /**
209
- * - 文件大小(字节数)
210
- */
211
- size: number;
212
- /**
213
- * - busid(目前不清楚有什么作用)
214
- */
215
- busid: number;
216
- };
217
- }
218
- /**
219
- * - 群管理员变动事件
220
- */
221
- export interface OneBot11GroupAdmin extends OneBot11Notice {
222
- /**
223
- * - 通知类型
224
- */
225
- notice_type: OB11NoticeType.GroupAdmin;
226
- /**
227
- * - 事件子类型,分别表示设置和取消管理员
228
- */
229
- sub_type: 'set' | 'unset';
230
- /**
231
- * - 群号
232
- */
233
- group_id: string;
234
- /**
235
- * - 管理员 QQ 号
236
- */
237
- user_id: string;
238
- }
239
- /**
240
- * - 群减少事件
241
- */
242
- export interface OneBot11GroupDecrease extends OneBot11Notice {
243
- /**
244
- * - 通知类型
245
- */
246
- notice_type: OB11NoticeType.GroupDecrease;
247
- /**
248
- * - 事件子类型,分别表示主动退群、成员被踢、登录号被踢
249
- */
250
- sub_type: 'leave' | 'kick' | 'kick_me';
251
- /**
252
- * - 群号
253
- */
254
- group_id: string;
255
- /**
256
- * - 操作者 QQ 号(如果是主动退群,则和 user_id 相同)
257
- */
258
- operator_id: string;
259
- /**
260
- * - 离开者 QQ 号
261
- */
262
- user_id: string;
263
- }
264
- /**
265
- * - 群增加事件
266
- */
267
- export interface OneBot11GroupIncrease extends OneBot11Notice {
268
- /**
269
- * - 通知类型
270
- */
271
- notice_type: OB11NoticeType.GroupIncrease;
272
- /**
273
- * - 事件子类型,分别表示管理员已同意入群、管理员邀请入群
274
- */
275
- sub_type: 'approve' | 'invite';
276
- /**
277
- * - 群号
278
- */
279
- group_id: string;
280
- /**
281
- * - 操作者 QQ 号
282
- */
283
- operator_id: string;
284
- /**
285
- * - 加入者 QQ 号
286
- */
287
- user_id: string;
288
- }
289
- /**
290
- * - 群禁言事件
291
- */
292
- export interface OneBot11GroupBan extends OneBot11Notice {
293
- /**
294
- * - 通知类型
295
- */
296
- notice_type: OB11NoticeType.GroupBan;
297
- /**
298
- * - 事件子类型,分别表示禁言、解除禁言
299
- */
300
- sub_type: 'ban' | 'lift_ban';
301
- /**
302
- * - 群号
303
- */
304
- group_id: string;
305
- /**
306
- * - 操作者 QQ 号
307
- */
308
- operator_id: string;
309
- /**
310
- * - 被禁言 QQ 号
311
- */
312
- user_id: string;
313
- /**
314
- * - 禁言时长,单位秒
315
- */
316
- duration: number;
317
- }
318
- /**
319
- * - 新添加好友事件
320
- */
321
- export interface OneBot11FriendAdd extends OneBot11Notice {
322
- /**
323
- * - 通知类型
324
- */
325
- notice_type: OB11NoticeType.FriendAdd;
326
- /**
327
- * - 新添加好友 QQ 号
328
- */
329
- user_id: string;
330
- }
331
- /**
332
- * - 群撤回事件
333
- */
334
- export interface OneBot11GroupRecall extends OneBot11Notice {
335
- /**
336
- * - 通知类型
337
- */
338
- notice_type: OB11NoticeType.GroupRecall;
339
- /**
340
- * - 群号
341
- */
342
- group_id: string;
343
- /**
344
- * - 消息发送者 QQ 号
345
- */
346
- user_id: string;
347
- /**
348
- * - 操作者 QQ 号
349
- */
350
- operator_id: string;
351
- /**
352
- * - 被撤回的消息 ID
353
- */
354
- message_id: string;
355
- }
356
- /**
357
- * - 好友消息撤回事件
358
- */
359
- export interface OneBot11FriendRecall extends OneBot11Notice {
360
- /**
361
- * - 通知类型
362
- */
363
- notice_type: OB11NoticeType.FriendRecall;
364
- /**
365
- * - 好友 QQ 号
366
- */
367
- user_id: string;
368
- /**
369
- * - 被撤回的消息 ID
370
- */
371
- message_id: string;
372
- }
373
- /**
374
- * - 戳一戳事件
375
- */
376
- export interface OneBot11Poke extends OneBot11Notice {
377
- /**
378
- * - 消息类型
379
- */
380
- notice_type: OB11NoticeType.Notify;
381
- /**
382
- * - 提示类型
383
- */
384
- sub_type: 'poke';
385
- /**
386
- * - 群号
387
- */
388
- group_id: string;
389
- /**
390
- * - 发送者 QQ 号
391
- */
392
- user_id: string;
393
- /**
394
- * - 被戳者 QQ 号
395
- */
396
- target_id: string;
397
- }
398
- /**
399
- * - 运气王事件
400
- */
401
- export interface OneBot11LuckyKing extends OneBot11Notice {
402
- /**
403
- * - 消息类型
404
- */
405
- notice_type: OB11NoticeType.Notify;
406
- /**
407
- * - 提示类型
408
- */
409
- sub_type: 'lucky_king';
410
- /**
411
- * - 群号
412
- */
413
- group_id: string;
414
- /**
415
- * - 红包发送者 QQ 号
416
- */
417
- user_id: string;
418
- /**
419
- * - 运气王 QQ 号
420
- */
421
- target_id: string;
422
- }
423
- /**
424
- * - 荣誉变更事件
425
- */
426
- export interface OneBot11Honor extends OneBot11Notice {
427
- /**
428
- * - 消息类型
429
- */
430
- notice_type: OB11NoticeType.Notify;
431
- /**
432
- * - 提示类型
433
- */
434
- sub_type: 'honor';
435
- /**
436
- * - 群号
437
- */
438
- group_id: string;
439
- /**
440
- * - 荣誉类型,分别表示龙王、群聊之火、快乐源泉
441
- */
442
- honor_type: 'talkative' | 'performer' | 'emotion';
443
- /**
444
- * - 成员 QQ 号
445
- */
446
- user_id: string;
447
- }
448
- /**
449
- * - 群表情回应事件
450
- */
451
- export interface OneBot11GroupMessageReaction extends OneBot11Notice {
452
- /**
453
- * - 消息类型
454
- */
455
- notice_type: OB11NoticeType.GroupMsgEmojiLike;
456
- /**
457
- * - 群号
458
- */
459
- group_id: string;
460
- /**
461
- * - 发送者 QQ 号
462
- */
463
- user_id: string;
464
- /**
465
- * - 消息 ID
466
- */
467
- message_id: string;
468
- /**
469
- * - 表情信息 此处目前只有llob有
470
- */
471
- likes: Array<{
472
- count: number;
473
- /**
474
- * - 表情ID参考: https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType
475
- */
476
- emoji_id: number;
477
- }>;
478
- }
479
- /**
480
- * 请求事件类型
481
- */
482
- export declare const enum OB11RequestType {
483
- Friend = "friend",
484
- Group = "group"
485
- }
486
- /**
487
- * - 请求事件基类
488
- */
489
- export interface OneBot11Request extends OB11Event {
490
- /**
491
- * - 事件发生的时间戳
492
- */
493
- time: number;
494
- /**
495
- * - 事件类型
496
- */
497
- post_type: OB11PostType.Request;
498
- /**
499
- * - 收到事件的机器人 QQ 号
500
- */
501
- self_id: string;
502
- /**
503
- * - 请求类型
504
- */
505
- request_type: OB11RequestType.Friend | OB11RequestType.Group;
506
- /**
507
- * - 请求 flag,在调用处理请求的 API 时需要传入
508
- */
509
- flag: string;
510
- /**
511
- * - 发送请求的 QQ 号
512
- */
513
- user_id: string;
514
- /**
515
- * - 验证信息
516
- */
517
- comment: string;
518
- }
519
- /**
520
- * - 好友请求事件
521
- */
522
- export interface OneBot11FriendRequest extends OneBot11Request {
523
- /**
524
- * - 请求类型
525
- */
526
- request_type: OB11RequestType.Friend;
527
- }
528
- /**
529
- * - 群请求事件
530
- */
531
- export interface OneBot11GroupRequest extends OneBot11Request {
532
- /**
533
- * - 请求类型
534
- */
535
- request_type: OB11RequestType.Group;
536
- /**
537
- * - 请求子类型,分别表示加群请求、邀请登录号入群
538
- */
539
- sub_type: 'add' | 'invite';
540
- /**
541
- * - 群号
542
- */
543
- group_id: string;
544
- }
545
- /**
546
- * - 元事件基类
547
- */
548
- export interface OneBot11MetaEvent extends OB11Event {
549
- /**
550
- * - 事件类型
551
- */
552
- post_type: OB11PostType.MetaEvent;
553
- /**
554
- * - 元事件类型
555
- */
556
- meta_event_type: 'lifecycle' | 'heartbeat';
557
- }
558
- /**
559
- * - 生命周期元事件
560
- */
561
- export interface OneBot11Lifecycle extends OneBot11MetaEvent {
562
- /**
563
- * - 元事件类型
564
- */
565
- meta_event_type: 'lifecycle';
566
- /**
567
- * - 事件子类型,分别表示 OneBot 启用、停用、WebSocket 连接成功
568
- */
569
- sub_type: 'enable' | 'disable' | 'connect';
570
- }
571
- /**
572
- * - 心跳元事件
573
- */
574
- export interface OneBot11Heartbeat extends OneBot11MetaEvent {
575
- /**
576
- * - 元事件类型
577
- */
578
- meta_event_type: 'heartbeat';
579
- /**
580
- * - 状态信息
581
- */
582
- status: {
583
- /**
584
- * - 到下次心跳的间隔,单位毫秒
585
- */
586
- interval: number;
587
- };
588
- }
589
- /**
590
- * 所有消息事件类型
591
- */
592
- export type OB11MessageEvent = OB11PrivateMessage | OB11GroupMessage;
593
- /**
594
- * 所有通知事件类型
595
- */
596
- export type OB11NoticeEvent = OneBot11GroupUpload | OneBot11GroupAdmin | OneBot11GroupDecrease | OneBot11GroupIncrease | OneBot11GroupBan | OneBot11FriendAdd | OneBot11GroupRecall | OneBot11FriendRecall | OneBot11Poke | OneBot11LuckyKing | OneBot11Honor | OneBot11GroupMessageReaction;
597
- /**
598
- * 所有请求事件类型
599
- */
600
- export type OB11RequestEvent = OneBot11FriendRequest | OneBot11GroupRequest;
601
- /**
602
- * 所有元事件类型
603
- */
604
- export type OB11MetaEvent = OneBot11Lifecycle | OneBot11Heartbeat;
605
- /**
606
- * 所有事件类型
607
- */
608
- export type OB11EventAll = OB11MessageEvent | OB11NoticeEvent | OB11RequestEvent | OB11MetaEvent;
609
- export interface EventMap {
610
- [OB11PostType.Message]: OB11MessageEvent;
611
- [OB11PostType.MessageSent]: OB11MessageEvent;
612
- [OB11PostType.Notice]: OB11NoticeEvent;
613
- [OB11PostType.Request]: OB11RequestEvent;
614
- [OB11PostType.MetaEvent]: OB11MetaEvent;
615
- }
616
- /**
617
- * 事件泛型 传入 post_type 返回对应的事件类型
618
- */
619
- export type EventByPostType<T extends OB11PostType> = T extends keyof EventMap ? EventMap[T] : never;
@@ -1,2 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
- export {};
@@ -1,6 +0,0 @@
1
- export * from './event.js';
2
- export * from './api.js';
3
- export * from './params.js';
4
- export * from './response.js';
5
- export * from './sender.js';
6
- export * from './segment.js';
@@ -1,6 +0,0 @@
1
- export * from './event.js';
2
- export * from './api.js';
3
- export * from './params.js';
4
- export * from './response.js';
5
- export * from './sender.js';
6
- export * from './segment.js';