@zhin.js/adapter-discord 1.1.3 → 1.1.4
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 +14 -0
- package/lib/side-event-dispatch.js +9 -10
- package/package.json +7 -7
- package/src/side-event-dispatch.ts +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @zhin.js/adapter-discord
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 43eda99: Unify Notice and Request payloads with their public types and runtime exports. Use camelCase fields, preserve native data under metadata, and bind canonical endpoint identity and request actions to the held generation. Remove legacy data aliases and from factories.
|
|
8
|
+
|
|
9
|
+
Keep login and lifecycle signals as independent SystemEvent payloads on system.receive, without chat conversation fields or user interaction. Update built-in adapter projections and authoring guidance.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [43eda99]
|
|
12
|
+
- Updated dependencies [0de4836]
|
|
13
|
+
- @zhin.js/core@1.1.39
|
|
14
|
+
- @zhin.js/permission@1.1.3
|
|
15
|
+
- @zhin.js/adapter@1.1.15
|
|
16
|
+
|
|
3
17
|
## 1.1.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { buildNotice, senderFromId } from '@zhin.js/core';
|
|
1
|
+
import { composeSideEventName, buildNotice, senderFromId } from '@zhin.js/core';
|
|
2
2
|
import { formatCompact } from '@zhin.js/logger';
|
|
3
3
|
export function receiveDiscordGuildMemberSideEvent(emit, configId, kind, event, logger) {
|
|
4
4
|
if (!emit)
|
|
5
5
|
return;
|
|
6
6
|
void emit('notice.receive', buildNotice(event, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$timestamp: Date.now(),
|
|
7
|
+
id: `discord:guild_member:${kind}:${event.guildId}:${event.userId}:${Date.now()}`,
|
|
8
|
+
clientAdapter: 'discord',
|
|
9
|
+
endpointId: configId,
|
|
10
|
+
type: 'notice',
|
|
11
|
+
// Guild membership does not identify a replyable channel.
|
|
12
|
+
name: composeSideEventName('notice', 'group', kind),
|
|
13
|
+
target: senderFromId(event.userId, event.userName),
|
|
14
|
+
timestamp: Date.now(),
|
|
16
15
|
})).catch((err) => {
|
|
17
16
|
logger.warn(formatCompact({
|
|
18
17
|
op: 'discord_side_event_failed',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-discord",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Zhin.js Discord adapter for Plugin Runtime (Gateway WebSocket)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"discord.js": "^14.27.0",
|
|
36
36
|
"@zhin.js/adapter": "1.1.15",
|
|
37
37
|
"@zhin.js/agent-feature": "1.1.2",
|
|
38
|
-
"@zhin.js/core": "1.1.
|
|
38
|
+
"@zhin.js/core": "1.1.39",
|
|
39
39
|
"@zhin.js/feature-kit": "1.1.2",
|
|
40
40
|
"@zhin.js/host-http": "1.1.2",
|
|
41
41
|
"@zhin.js/im-contract": "1.1.2",
|
|
42
42
|
"@zhin.js/logger": "1.1.1",
|
|
43
|
-
"@zhin.js/permission": "1.1.
|
|
43
|
+
"@zhin.js/permission": "1.1.3",
|
|
44
44
|
"@zhin.js/skill": "1.1.2",
|
|
45
45
|
"@zhin.js/tool": "1.1.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"zod": "^4.0.0",
|
|
49
49
|
"@zhin.js/adapter": "^1.1.15",
|
|
50
|
-
"@zhin.js/command": "^1.1.
|
|
51
|
-
"@zhin.js/core": "^1.1.
|
|
52
|
-
"zhin.js": "^1.1.
|
|
50
|
+
"@zhin.js/command": "^1.1.3",
|
|
51
|
+
"@zhin.js/core": "^1.1.39",
|
|
52
|
+
"zhin.js": "^1.1.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@zhin.js/command": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"vitest": "^4.1.10",
|
|
69
69
|
"zod": "^4.4.3",
|
|
70
70
|
"@zhin.js/host-http": "1.1.2",
|
|
71
|
-
"zhin.js": "1.1.
|
|
71
|
+
"zhin.js": "1.1.4"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"adapters",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildNotice, senderFromId } from '@zhin.js/core';
|
|
1
|
+
import { composeSideEventName, buildNotice, senderFromId } from '@zhin.js/core';
|
|
2
2
|
import type { EndpointEventEmitter } from 'zhin.js/adapter';
|
|
3
3
|
import { formatCompact, type getAdapterLogger } from '@zhin.js/logger';
|
|
4
4
|
|
|
@@ -17,15 +17,14 @@ export function receiveDiscordGuildMemberSideEvent(
|
|
|
17
17
|
): void {
|
|
18
18
|
if (!emit) return;
|
|
19
19
|
void emit('notice.receive', buildNotice(event, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$timestamp: Date.now(),
|
|
20
|
+
id: `discord:guild_member:${kind}:${event.guildId}:${event.userId}:${Date.now()}`,
|
|
21
|
+
clientAdapter: 'discord',
|
|
22
|
+
endpointId: configId,
|
|
23
|
+
type: 'notice',
|
|
24
|
+
// Guild membership does not identify a replyable channel.
|
|
25
|
+
name: composeSideEventName('notice', 'group', kind),
|
|
26
|
+
target: senderFromId(event.userId, event.userName),
|
|
27
|
+
timestamp: Date.now(),
|
|
29
28
|
})).catch((err) => {
|
|
30
29
|
logger.warn(formatCompact({
|
|
31
30
|
op: 'discord_side_event_failed',
|