@zhin.js/adapter-slack 5.0.4 → 5.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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.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
+ ## 5.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
  ## 5.0.4
4
33
 
5
34
  ### Patch Changes
package/lib/endpoint.d.ts CHANGED
@@ -152,6 +152,7 @@ export declare class SlackEndpoint implements EndpointInstance, SlackWebhookHand
152
152
  channel: string;
153
153
  ts: string;
154
154
  } | null;
155
+ recallMessage(messageId: string): Promise<void>;
155
156
  editMessage(channel: string, messageTs: string, content: unknown): Promise<void>;
156
157
  inviteToChannel(channel: string, users: string[]): Promise<boolean>;
157
158
  kickFromChannel(channel: string, user: string): Promise<boolean>;
package/lib/endpoint.js CHANGED
@@ -234,6 +234,14 @@ export class SlackEndpoint {
234
234
  const channel = this.#messageChannelMap.get(messageId);
235
235
  return channel ? { channel, ts: messageId } : null;
236
236
  }
237
+ async recallMessage(messageId) {
238
+ if (!this.#client)
239
+ return;
240
+ const ref = this.resolveMessageRef(messageId);
241
+ if (!ref)
242
+ return;
243
+ await this.#client.chat.delete({ channel: ref.channel, ts: ref.ts });
244
+ }
237
245
  async editMessage(channel, messageTs, content) {
238
246
  if (!this.#client)
239
247
  throw new Error('Slack client not connected');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-slack",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "Zhin.js Slack adapter for Plugin Runtime (Socket Mode / HTTP Events)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -32,21 +32,21 @@
32
32
  "directory": "plugins/adapters/slack"
33
33
  },
34
34
  "dependencies": {
35
- "@slack/socket-mode": "^2.0.3",
36
- "@slack/web-api": "^7.17.0",
35
+ "@slack/socket-mode": "^2.0.7",
36
+ "@slack/web-api": "^7.19.0",
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.3",
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.9",
47
+ "@zhin.js/agent": "1.0.10",
48
48
  "@zhin.js/core": "1.4.3",
49
- "@zhin.js/host-http": "1.0.3",
49
+ "@zhin.js/host-http": "1.0.4",
50
50
  "@zhin.js/plugin-runtime": "1.1.1",
51
51
  "zhin.js": "5.0.3"
52
52
  },
@@ -62,11 +62,11 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@types/node": "^26.1.0",
65
+ "@types/node": "^26.1.2",
66
66
  "typescript": "^6.0.3",
67
67
  "vitest": "^4.1.10",
68
68
  "zod": "^4.4.3",
69
- "@zhin.js/agent": "1.0.9",
69
+ "@zhin.js/agent": "1.0.10",
70
70
  "zhin.js": "5.0.3"
71
71
  },
72
72
  "files": [
package/src/endpoint.ts CHANGED
@@ -330,6 +330,13 @@ export class SlackEndpoint implements EndpointInstance, SlackWebhookHandler {
330
330
  return channel ? { channel, ts: messageId } : null;
331
331
  }
332
332
 
333
+ async recallMessage(messageId: string): Promise<void> {
334
+ if (!this.#client) return;
335
+ const ref = this.resolveMessageRef(messageId);
336
+ if (!ref) return;
337
+ await this.#client.chat.delete({ channel: ref.channel, ts: ref.ts });
338
+ }
339
+
333
340
  async editMessage(channel: string, messageTs: string, content: unknown): Promise<void> {
334
341
  if (!this.#client) throw new Error('Slack client not connected');
335
342
  await editSlackContent(this.#client, channel, messageTs, content);