@zhin.js/adapter-onebot11 1.0.69 → 1.0.70
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 +9 -0
- package/lib/index.js +4 -3
- package/lib/index.js.map +1 -1
- package/package.json +6 -5
- package/plugin.yml +3 -0
- package/src/index.ts +4 -3
package/CHANGELOG.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -7,7 +7,8 @@ export * from './types.js';
|
|
|
7
7
|
export { OneBot11WsClient } from './bot-ws-client.js';
|
|
8
8
|
export { OneBot11WsServer } from './bot-ws-server.js';
|
|
9
9
|
export { OneBot11Adapter } from './adapter.js';
|
|
10
|
-
const
|
|
10
|
+
const plugin = usePlugin();
|
|
11
|
+
const { provide, useContext } = plugin;
|
|
11
12
|
provide({
|
|
12
13
|
name: 'onebot11',
|
|
13
14
|
description: 'OneBot11 协议适配器(正向 WS / 反向 WS)',
|
|
@@ -22,7 +23,7 @@ provide({
|
|
|
22
23
|
});
|
|
23
24
|
useContext('tool', 'onebot11', (toolService, onebot11) => {
|
|
24
25
|
const groupTools = createGroupManagementTools(onebot11, 'onebot11');
|
|
25
|
-
const disposers = groupTools.map(t => toolService.addTool(t,
|
|
26
|
+
const disposers = groupTools.map(t => toolService.addTool(t, plugin.name));
|
|
26
27
|
// Platform-specific tool: set title
|
|
27
28
|
disposers.push(toolService.addTool({
|
|
28
29
|
name: 'onebot11_set_title',
|
|
@@ -46,7 +47,7 @@ useContext('tool', 'onebot11', (toolService, onebot11) => {
|
|
|
46
47
|
const success = await bot.setTitle(args.group_id, args.user_id, args.title);
|
|
47
48
|
return { success, message: success ? `已将 ${args.user_id} 的头衔设为 "${args.title}"` : '设置失败' };
|
|
48
49
|
},
|
|
49
|
-
},
|
|
50
|
+
}, plugin.name));
|
|
50
51
|
return () => disposers.forEach(d => d());
|
|
51
52
|
});
|
|
52
53
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAoD,0BAA0B,EAAoB,MAAM,SAAS,CAAC;AAEpI,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAajE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAoD,0BAA0B,EAAoB,MAAM,SAAS,CAAC;AAEpI,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAajE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC3B,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;AACvC,OAAO,CAAC;IACN,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,+BAA+B;IAC5C,OAAO,EAAE,KAAK,EAAE,CAAS,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAwB,EAAE,EAAE;QAC1C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AC,CAAC;YACjD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,WAAW,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC7F,CAAC;KACF,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-onebot11",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.70",
|
|
4
4
|
"description": "Zhin.js adapter for OneBot v11 protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"client",
|
|
19
19
|
"dist",
|
|
20
20
|
"skills",
|
|
21
|
+
"plugin.yml",
|
|
21
22
|
"README.md",
|
|
22
23
|
"CHANGELOG.md"
|
|
23
24
|
],
|
|
@@ -48,12 +49,12 @@
|
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/node": "^24.3.0",
|
|
50
51
|
"@types/ws": "^8.18.1",
|
|
51
|
-
"typescript": "^
|
|
52
|
-
"zhin.js": "1.0.
|
|
52
|
+
"typescript": "^6.0.0",
|
|
53
|
+
"zhin.js": "1.0.64"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
|
-
"@zhin.js/http": "1.0.
|
|
56
|
-
"zhin.js": "1.0.
|
|
56
|
+
"@zhin.js/http": "1.0.59",
|
|
57
|
+
"zhin.js": "1.0.64"
|
|
57
58
|
},
|
|
58
59
|
"peerDependenciesMeta": {
|
|
59
60
|
"@zhin.js/http": {
|
package/plugin.yml
ADDED
package/src/index.ts
CHANGED
|
@@ -21,7 +21,8 @@ declare module 'zhin.js' {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const plugin = usePlugin();
|
|
25
|
+
const { provide, useContext } = plugin;
|
|
25
26
|
provide({
|
|
26
27
|
name: 'onebot11',
|
|
27
28
|
description: 'OneBot11 协议适配器(正向 WS / 反向 WS)',
|
|
@@ -40,7 +41,7 @@ useContext('tool', 'onebot11', (toolService: ToolFeature, onebot11: OneBot11Adap
|
|
|
40
41
|
onebot11 as unknown as IGroupManagement,
|
|
41
42
|
'onebot11',
|
|
42
43
|
);
|
|
43
|
-
const disposers: (() => void)[] = groupTools.map(t => toolService.addTool(t,
|
|
44
|
+
const disposers: (() => void)[] = groupTools.map(t => toolService.addTool(t, plugin.name));
|
|
44
45
|
|
|
45
46
|
// Platform-specific tool: set title
|
|
46
47
|
disposers.push(toolService.addTool({
|
|
@@ -64,7 +65,7 @@ useContext('tool', 'onebot11', (toolService: ToolFeature, onebot11: OneBot11Adap
|
|
|
64
65
|
const success = await bot.setTitle(args.group_id, args.user_id, args.title);
|
|
65
66
|
return { success, message: success ? `已将 ${args.user_id} 的头衔设为 "${args.title}"` : '设置失败' };
|
|
66
67
|
},
|
|
67
|
-
},
|
|
68
|
+
}, plugin.name));
|
|
68
69
|
|
|
69
70
|
return () => disposers.forEach(d => d());
|
|
70
71
|
});
|