@zhin.js/adapter-kook 6.0.4 → 6.0.6
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 +29 -0
- package/lib/endpoint.d.ts +2 -0
- package/lib/endpoint.js +10 -0
- package/lib/ws.d.ts +1 -0
- package/package.json +7 -7
- package/src/endpoint.ts +10 -0
- package/src/ws.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @zhin.js/adapter-kook
|
|
2
2
|
|
|
3
|
+
## 6.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d52f3c5: fix: QQ 适配器群聊误识别为私聊、game-kit 启动崩溃、全面补齐 recallMessage
|
|
8
|
+
|
|
9
|
+
- fix(cli): `resolveChannelType` 增加 `metadata.channelKind` 检查,修复 QQ/Discord/KOOK 群聊消息被误分类为私聊
|
|
10
|
+
- fix(game-kit): `createHostGameDb` 改用延迟代理模型,避免数据库启动前解析模型导致崩溃
|
|
11
|
+
- feat(qq): 实现 `recallMessage`,解析复合 messageId 路由到对应 SDK 撤回方法;`normalizeQqMessage` 增加 `message_type` 缺失时的回退检测
|
|
12
|
+
- feat(slack): 实现 `recallMessage`,利用已有 compound ref 和 `chat.delete` API
|
|
13
|
+
- feat(onebot11): 两个 endpoint 类实现 `recallMessage`(`delete_msg`)
|
|
14
|
+
- feat(onebot12): 两个 endpoint 类实现 `recallMessage`(`delete_message`)
|
|
15
|
+
- feat(napcat): 三个 endpoint 类实现 `recallMessage`(`delete_msg`)
|
|
16
|
+
- feat(discord): 两个 endpoint 类实现 `recallMessage`;`send()` 改为返回 `channelId:snowflake` 复合 ID
|
|
17
|
+
- feat(telegram): 实现 `recallMessage`(`deleteMessage`);`send()` 改为返回 `chatId:messageId` 复合 ID
|
|
18
|
+
- feat(kook): 两个 endpoint 类实现 `recallMessage`,利用 kook-client `recallMsg` API
|
|
19
|
+
- feat(lark): 实现 `recallMessage`(`DELETE /im/v1/messages/{id}`)
|
|
20
|
+
- feat(wecom): 实现 `recallMessage`(`POST /cgi-bin/message/recall`)
|
|
21
|
+
|
|
22
|
+
## 6.0.5
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [d8bf702]
|
|
27
|
+
- @zhin.js/host-http@1.0.4
|
|
28
|
+
- @zhin.js/agent@1.0.10
|
|
29
|
+
- @zhin.js/core@1.4.3
|
|
30
|
+
- zhin.js@5.0.3
|
|
31
|
+
|
|
3
32
|
## 6.0.4
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class KookWebsocketEndpoint implements EndpointInstance {
|
|
|
24
24
|
}): Promise<string>;
|
|
25
25
|
/** Test / internal: admit a message when open. */
|
|
26
26
|
admit(msg: KookInboundMessage): void;
|
|
27
|
+
recallMessage(messageId: string): Promise<void>;
|
|
27
28
|
getRoleList(guildId: string): Promise<{
|
|
28
29
|
role_id: string | number;
|
|
29
30
|
name: string;
|
|
@@ -66,6 +67,7 @@ export declare class KookWebhookEndpoint implements EndpointInstance {
|
|
|
66
67
|
}): Promise<string>;
|
|
67
68
|
/** Test / internal: admit a message when open. */
|
|
68
69
|
admit(msg: KookInboundMessage): void;
|
|
70
|
+
recallMessage(messageId: string): Promise<void>;
|
|
69
71
|
checkAndRememberSn(sn: number): boolean;
|
|
70
72
|
getRoleList(guildId: string): Promise<{
|
|
71
73
|
role_id: string | number;
|
package/lib/endpoint.js
CHANGED
|
@@ -107,6 +107,11 @@ export class KookWebsocketEndpoint {
|
|
|
107
107
|
}));
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
+
async recallMessage(messageId) {
|
|
111
|
+
if (!messageId)
|
|
112
|
+
return;
|
|
113
|
+
await this.#requireClient().recallMsg?.(messageId);
|
|
114
|
+
}
|
|
110
115
|
// ── Agent tool surface ──────────────────────────────────────────────
|
|
111
116
|
async getRoleList(guildId) {
|
|
112
117
|
return this.#requireClient().pickGuild(guildId).getRoleList();
|
|
@@ -261,6 +266,11 @@ export class KookWebhookEndpoint {
|
|
|
261
266
|
}));
|
|
262
267
|
});
|
|
263
268
|
}
|
|
269
|
+
async recallMessage(messageId) {
|
|
270
|
+
if (!messageId)
|
|
271
|
+
return;
|
|
272
|
+
await this.#requireClient().recallMsg?.(messageId);
|
|
273
|
+
}
|
|
264
274
|
checkAndRememberSn(sn) {
|
|
265
275
|
if (this.#processedSn.has(sn))
|
|
266
276
|
return false;
|
package/lib/ws.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface KookClientTransport {
|
|
|
11
11
|
sendPrivateMsg(userId: string, message: string): Promise<{
|
|
12
12
|
msg_id?: string | number;
|
|
13
13
|
}>;
|
|
14
|
+
recallMsg?(messageId: string): Promise<boolean>;
|
|
14
15
|
pickGuild(guildId: string): {
|
|
15
16
|
kick(userId: string): Promise<boolean>;
|
|
16
17
|
getRoleList(): Promise<Array<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-kook",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
4
4
|
"description": "Zhin.js KOOK adapter for Plugin Runtime (WebSocket gateway or Webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"@zhin.js/adapter": "1.1.2",
|
|
38
38
|
"@zhin.js/command": "1.0.4",
|
|
39
39
|
"@zhin.js/core": "1.4.3",
|
|
40
|
-
"@zhin.js/host-http": "1.0.
|
|
40
|
+
"@zhin.js/host-http": "1.0.4",
|
|
41
41
|
"@zhin.js/logger": "1.0.75",
|
|
42
42
|
"@zhin.js/plugin-runtime": "1.1.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"zod": "^4.0.0",
|
|
46
46
|
"@zhin.js/adapter": "1.1.2",
|
|
47
|
-
"@zhin.js/agent": "1.0.
|
|
47
|
+
"@zhin.js/agent": "1.0.10",
|
|
48
48
|
"@zhin.js/core": "1.4.3",
|
|
49
49
|
"@zhin.js/plugin-runtime": "1.1.1",
|
|
50
50
|
"zhin.js": "5.0.3"
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@types/node": "^26.1.
|
|
64
|
+
"@types/node": "^26.1.2",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
66
|
"vitest": "^4.1.10",
|
|
67
67
|
"zod": "^4.4.3",
|
|
68
|
-
"@zhin.js/agent": "1.0.
|
|
69
|
-
"zhin.js": "
|
|
70
|
-
"
|
|
68
|
+
"@zhin.js/agent": "1.0.10",
|
|
69
|
+
"@zhin.js/host-http": "1.0.4",
|
|
70
|
+
"zhin.js": "5.0.3"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"adapters",
|
package/src/endpoint.ts
CHANGED
|
@@ -148,6 +148,11 @@ export class KookWebsocketEndpoint implements EndpointInstance {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
async recallMessage(messageId: string): Promise<void> {
|
|
152
|
+
if (!messageId) return;
|
|
153
|
+
await this.#requireClient().recallMsg?.(messageId);
|
|
154
|
+
}
|
|
155
|
+
|
|
151
156
|
// ── Agent tool surface ──────────────────────────────────────────────
|
|
152
157
|
|
|
153
158
|
async getRoleList(guildId: string) {
|
|
@@ -323,6 +328,11 @@ export class KookWebhookEndpoint implements EndpointInstance {
|
|
|
323
328
|
});
|
|
324
329
|
}
|
|
325
330
|
|
|
331
|
+
async recallMessage(messageId: string): Promise<void> {
|
|
332
|
+
if (!messageId) return;
|
|
333
|
+
await this.#requireClient().recallMsg?.(messageId);
|
|
334
|
+
}
|
|
335
|
+
|
|
326
336
|
checkAndRememberSn(sn: number): boolean {
|
|
327
337
|
if (this.#processedSn.has(sn)) return false;
|
|
328
338
|
this.#processedSn.add(sn);
|
package/src/ws.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface KookClientTransport {
|
|
|
24
24
|
userId: string,
|
|
25
25
|
message: string,
|
|
26
26
|
): Promise<{ msg_id?: string | number }>;
|
|
27
|
+
recallMsg?(messageId: string): Promise<boolean>;
|
|
27
28
|
pickGuild(guildId: string): {
|
|
28
29
|
kick(userId: string): Promise<boolean>;
|
|
29
30
|
getRoleList(): Promise<Array<{
|