ErisPulse 2.1.2__tar.gz → 2.1.3__tar.gz

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 (68) hide show
  1. {erispulse-2.1.2 → erispulse-2.1.3}/LICENSE +6 -4
  2. {erispulse-2.1.2 → erispulse-2.1.3}/PKG-INFO +7 -5
  3. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AIDocs/ErisPulse-AdapterDev.md +43 -23
  4. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AIDocs/ErisPulse-Core.md +57 -14
  5. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AIDocs/ErisPulse-Full.md +86 -23
  6. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AIDocs/ErisPulse-ModuleDev.md +61 -18
  7. {erispulse-2.1.2 → erispulse-2.1.3}/docs/CHANGELOG.md +10 -0
  8. {erispulse-2.1.2 → erispulse-2.1.3}/docs/Development/Adapter.md +25 -5
  9. {erispulse-2.1.2 → erispulse-2.1.3}/docs/PlatformFeatures.md +43 -0
  10. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/adapter.md +2 -2
  11. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/env.md +2 -2
  12. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/logger.md +2 -2
  13. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/mods.md +2 -2
  14. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/raiserr.md +2 -2
  15. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/server.md +2 -2
  16. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/Core/util.md +2 -2
  17. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/__init__.md +2 -2
  18. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/ErisPulse/__main__.md +2 -2
  19. {erispulse-2.1.2 → erispulse-2.1.3}/pyproject.toml +1 -1
  20. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/adapter.py +1 -1
  21. {erispulse-2.1.2 → erispulse-2.1.3}/.github/assets/erispulse_logo.png +0 -0
  22. {erispulse-2.1.2 → erispulse-2.1.3}/.github/tools/merge_md.py +0 -0
  23. {erispulse-2.1.2 → erispulse-2.1.3}/.github/tools/update-api-docs.py +0 -0
  24. {erispulse-2.1.2 → erispulse-2.1.3}/.github/workflows/auto-tag-release.yml +0 -0
  25. {erispulse-2.1.2 → erispulse-2.1.3}/.github/workflows/pypi-publish.yml +0 -0
  26. {erispulse-2.1.2 → erispulse-2.1.3}/.gitignore +0 -0
  27. {erispulse-2.1.2 → erispulse-2.1.3}/.python-version +0 -0
  28. {erispulse-2.1.2 → erispulse-2.1.3}/CODE_OF_CONDUCT.md +0 -0
  29. {erispulse-2.1.2 → erispulse-2.1.3}/README.md +0 -0
  30. {erispulse-2.1.2 → erispulse-2.1.3}/devs/test.py +0 -0
  31. {erispulse-2.1.2 → erispulse-2.1.3}/devs/test_adapter.py +0 -0
  32. {erispulse-2.1.2 → erispulse-2.1.3}/devs/test_files/test.docx +0 -0
  33. {erispulse-2.1.2 → erispulse-2.1.3}/devs/test_files/test.jpg +0 -0
  34. {erispulse-2.1.2 → erispulse-2.1.3}/devs/test_files/test.mp4 +0 -0
  35. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AI-Module-Generation.md +0 -0
  36. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AdapterStandards/APIResponse.md +0 -0
  37. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AdapterStandards/EventConversion.md +0 -0
  38. {erispulse-2.1.2 → erispulse-2.1.3}/docs/AdapterStandards/README.md +0 -0
  39. {erispulse-2.1.2 → erispulse-2.1.3}/docs/CLI.md +0 -0
  40. {erispulse-2.1.2 → erispulse-2.1.3}/docs/Development/Module.md +0 -0
  41. {erispulse-2.1.2 → erispulse-2.1.3}/docs/Development/README.md +0 -0
  42. {erispulse-2.1.2 → erispulse-2.1.3}/docs/UseCore.md +0 -0
  43. {erispulse-2.1.2 → erispulse-2.1.3}/docs/api/README.md +0 -0
  44. {erispulse-2.1.2 → erispulse-2.1.3}/docs/quick-start.md +0 -0
  45. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-adapter/LICENSE +0 -0
  46. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-adapter/MyAdapter/Core.py +0 -0
  47. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-adapter/MyAdapter/__init__.py +0 -0
  48. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-adapter/README.md +0 -0
  49. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-adapter/pyproject.toml +0 -0
  50. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-module/LICENSE +0 -0
  51. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-module/MyModule/Core.py +0 -0
  52. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-module/MyModule/__init__.py +0 -0
  53. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-module/README.md +0 -0
  54. {erispulse-2.1.2 → erispulse-2.1.3}/examples/example-module/pyproject.toml +0 -0
  55. {erispulse-2.1.2 → erispulse-2.1.3}/scripts/install/install.ps1 +0 -0
  56. {erispulse-2.1.2 → erispulse-2.1.3}/scripts/install/install.sh +0 -0
  57. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/__init__.py +0 -0
  58. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/env.py +0 -0
  59. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/logger.py +0 -0
  60. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/mods.py +0 -0
  61. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/raiserr.py +0 -0
  62. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/server.py +0 -0
  63. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/shellprint.py +0 -0
  64. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/Core/util.py +0 -0
  65. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/__init__.py +0 -0
  66. {erispulse-2.1.2 → erispulse-2.1.3}/src/ErisPulse/__main__.py +0 -0
  67. {erispulse-2.1.2 → erispulse-2.1.3}/style_guide/DOCSTRING_SPEC.md +0 -0
  68. {erispulse-2.1.2 → erispulse-2.1.3}/style_guide/README.md +0 -0
@@ -22,8 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  SOFTWARE.
24
24
 
25
- The documentation portion of this project references content from https://codeberg.org/ybr/yhwiki,
26
- licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
27
- International License (CC BY-NC-ND 4.0).
25
+ This SDK's core adapter standardization layer strictly follows OneBot12 specifications (https://12.onebot.dev/) for:
26
+ - Event data normalization
27
+ - API request/response formats
28
+ - Message segment definitions
29
+ - Metadata definitions
28
30
 
29
- Note: This license file has been updated to correct the upstream project reference.
31
+ This ensures consistent behavior and interoperability across all adapter implementations.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ErisPulse
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: ErisPulse 是一个模块化、可扩展的异步 Python SDK 框架,主要用于构建高效、可维护的机器人应用程序。
5
5
  Author-email: "艾莉丝·格雷拉特(WSu2059)" <wsu2059@qq.com>, runoneall <runoobsteve@gmail.com>
6
6
  License: MIT License
@@ -27,11 +27,13 @@ License: MIT License
27
27
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
28
  SOFTWARE.
29
29
 
30
- The documentation portion of this project references content from https://codeberg.org/ybr/yhwiki,
31
- licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
32
- International License (CC BY-NC-ND 4.0).
30
+ This SDK's core adapter standardization layer strictly follows OneBot12 specifications (https://12.onebot.dev/) for:
31
+ - Event data normalization
32
+ - API request/response formats
33
+ - Message segment definitions
34
+ - Metadata definitions
33
35
 
34
- Note: This license file has been updated to correct the upstream project reference.
36
+ This ensures consistent behavior and interoperability across all adapter implementations.
35
37
  License-File: LICENSE
36
38
  Classifier: Development Status :: 5 - Production/Stable
37
39
  Classifier: Intended Audience :: Developers
@@ -247,12 +247,14 @@ class MyAdapter(BaseAdapter):
247
247
 
248
248
  class Send(BaseAdapter.Send): # 继承BaseAdapter内置的Send类
249
249
  """
250
- Send消息发送DSL,支持三种调用方式(继承的Send类包含了To方法,它会在用户调用时自动设置以下属性):
250
+ Send消息发送DSL,支持四种调用方式(继承的Send类包含了To和Using方法):
251
251
  1. 指定类型和ID: To(type,id).Func() -> 设置_target_type和_target_id/_target_to
252
252
  示例: Send.To("group",123).Text("hi")
253
- 2. 仅指定ID: To(id).Func() -> 只设置_target_id/_target_to
254
- 示例: Send.To("user@mail.com").Text("hi")
255
- 3. 直接调用: Func() -> 不设置目标属性
253
+ 2. 指定发送账号: Using(account_id).Func() -> 设置_account_id
254
+ 示例: Send.Using("bot1").Text("hi")
255
+ 3. 组合使用: Using(account_id).To(type,id).Func()
256
+ 示例: Send.Using("bot1").To("user","123").Text("hi")
257
+ 4. 直接调用: Func() -> 不设置目标属性
256
258
  示例: Send.Text("broadcast")
257
259
  """
258
260
 
@@ -337,12 +339,30 @@ class Send((BaseAdapter.Send):
337
339
  )
338
340
  ```
339
341
 
340
- 调用方式如下:
342
+ 调用方式支持以下组合:
341
343
 
344
+ 1. 指定发送账号和接收目标:
345
+ ```python
346
+ sdk.adapter.MyPlatform.Send.Using("bot1").To("user", "U1001").Text("你好")
347
+ ```
348
+
349
+ 2. 仅指定接收目标:
342
350
  ```python
343
351
  sdk.adapter.MyPlatform.Send.To("user", "U1001").Text("你好")
344
352
  ```
345
353
 
354
+ 3. 仅指定发送账号:
355
+ ```python
356
+ sdk.adapter.MyPlatform.Send.Using("bot1").Text("广播消息")
357
+ ```
358
+
359
+ 4. 直接调用:
360
+ ```python
361
+ sdk.adapter.MyPlatform.Send.Text("广播消息")
362
+ ```
363
+
364
+ `Using`方法用于指定发送账号,会设置`self._account_id`属性,可以在后续API调用中使用。
365
+
346
366
  ---
347
367
 
348
368
  ## 5. 事件转换与路由注册
@@ -912,7 +932,7 @@ def generate_message_id(platform: str, raw_id: str) -> str:
912
932
 
913
933
  # 📦 `ErisPulse.__init__` 模块
914
934
 
915
- *自动生成于 2025-07-17 16:39:14*
935
+ *自动生成于 2025-07-17 16:57:03*
916
936
 
917
937
  ---
918
938
 
@@ -1243,13 +1263,13 @@ SDK初始化入口
1243
1263
  ---
1244
1264
 
1245
1265
 
1246
- *文档最后更新于 2025-07-17 16:39:14*
1266
+ *文档最后更新于 2025-07-17 16:57:03*
1247
1267
 
1248
1268
  ## ErisPulse\__main__.md
1249
1269
 
1250
1270
  # 📦 `ErisPulse.__main__` 模块
1251
1271
 
1252
- *自动生成于 2025-07-17 16:39:14*
1272
+ *自动生成于 2025-07-17 16:57:03*
1253
1273
 
1254
1274
  ---
1255
1275
 
@@ -1438,13 +1458,13 @@ PyPI包管理器
1438
1458
  ---
1439
1459
 
1440
1460
 
1441
- *文档最后更新于 2025-07-17 16:39:14*
1461
+ *文档最后更新于 2025-07-17 16:57:03*
1442
1462
 
1443
1463
  ## ErisPulse\Core\adapter.md
1444
1464
 
1445
1465
  # 📦 `ErisPulse.Core.adapter` 模块
1446
1466
 
1447
- *自动生成于 2025-07-17 16:39:14*
1467
+ *自动生成于 2025-07-17 16:57:03*
1448
1468
 
1449
1469
  ---
1450
1470
 
@@ -1789,13 +1809,13 @@ OneBot12协议事件监听装饰器
1789
1809
  ---
1790
1810
 
1791
1811
 
1792
- *文档最后更新于 2025-07-17 16:39:14*
1812
+ *文档最后更新于 2025-07-17 16:57:03*
1793
1813
 
1794
1814
  ## ErisPulse\Core\env.md
1795
1815
 
1796
1816
  # 📦 `ErisPulse.Core.env` 模块
1797
1817
 
1798
- *自动生成于 2025-07-17 16:39:14*
1818
+ *自动生成于 2025-07-17 16:57:03*
1799
1819
 
1800
1820
  ---
1801
1821
 
@@ -2081,13 +2101,13 @@ ErisPulse 环境配置模块
2081
2101
  ---
2082
2102
 
2083
2103
 
2084
- *文档最后更新于 2025-07-17 16:39:14*
2104
+ *文档最后更新于 2025-07-17 16:57:03*
2085
2105
 
2086
2106
  ## ErisPulse\Core\logger.md
2087
2107
 
2088
2108
  # 📦 `ErisPulse.Core.logger` 模块
2089
2109
 
2090
- *自动生成于 2025-07-17 16:39:14*
2110
+ *自动生成于 2025-07-17 16:57:03*
2091
2111
 
2092
2112
  ---
2093
2113
 
@@ -2169,13 +2189,13 @@ ErisPulse 日志系统
2169
2189
  ---
2170
2190
 
2171
2191
 
2172
- *文档最后更新于 2025-07-17 16:39:14*
2192
+ *文档最后更新于 2025-07-17 16:57:03*
2173
2193
 
2174
2194
  ## ErisPulse\Core\mods.md
2175
2195
 
2176
2196
  # 📦 `ErisPulse.Core.mods` 模块
2177
2197
 
2178
- *自动生成于 2025-07-17 16:39:14*
2198
+ *自动生成于 2025-07-17 16:57:03*
2179
2199
 
2180
2200
  ---
2181
2201
 
@@ -2358,13 +2378,13 @@ ErisPulse 模块管理器
2358
2378
  ---
2359
2379
 
2360
2380
 
2361
- *文档最后更新于 2025-07-17 16:39:14*
2381
+ *文档最后更新于 2025-07-17 16:57:03*
2362
2382
 
2363
2383
  ## ErisPulse\Core\raiserr.md
2364
2384
 
2365
2385
  # 📦 `ErisPulse.Core.raiserr` 模块
2366
2386
 
2367
- *自动生成于 2025-07-17 16:39:14*
2387
+ *自动生成于 2025-07-17 16:57:03*
2368
2388
 
2369
2389
  ---
2370
2390
 
@@ -2468,13 +2488,13 @@ ErisPulse 错误管理系统
2468
2488
  ---
2469
2489
 
2470
2490
 
2471
- *文档最后更新于 2025-07-17 16:39:14*
2491
+ *文档最后更新于 2025-07-17 16:57:03*
2472
2492
 
2473
2493
  ## ErisPulse\Core\server.md
2474
2494
 
2475
2495
  # 📦 `ErisPulse.Core.server` 模块
2476
2496
 
2477
- *自动生成于 2025-07-17 16:39:14*
2497
+ *自动生成于 2025-07-17 16:57:03*
2478
2498
 
2479
2499
  ---
2480
2500
 
@@ -2595,13 +2615,13 @@ ErisPulse Adapter Server
2595
2615
  ---
2596
2616
 
2597
2617
 
2598
- *文档最后更新于 2025-07-17 16:39:14*
2618
+ *文档最后更新于 2025-07-17 16:57:03*
2599
2619
 
2600
2620
  ## ErisPulse\Core\util.md
2601
2621
 
2602
2622
  # 📦 `ErisPulse.Core.util` 模块
2603
2623
 
2604
- *自动生成于 2025-07-17 16:39:14*
2624
+ *自动生成于 2025-07-17 16:57:03*
2605
2625
 
2606
2626
  ---
2607
2627
 
@@ -2695,6 +2715,6 @@ ErisPulse 工具函数集合
2695
2715
  ---
2696
2716
 
2697
2717
 
2698
- *文档最后更新于 2025-07-17 16:39:14*
2718
+ *文档最后更新于 2025-07-17 16:57:03*
2699
2719
 
2700
2720
  <!--- End of API文档 -->
@@ -254,6 +254,7 @@ util.ExecAsync(sync_task)
254
254
  > 基线协议:(OneBot12)[https://12.onebot.dev/]
255
255
  >
256
256
  > 本文档为**快速使用指南**,包含:
257
+ > - 通用接口使用方法
257
258
  > - 各适配器支持的Send方法链式调用示例
258
259
  > - 平台特有的事件/消息格式说明
259
260
  >
@@ -264,6 +265,48 @@ util.ExecAsync(sync_task)
264
265
 
265
266
  ---
266
267
 
268
+ ## 通用接口
269
+
270
+ ### Send 链式调用
271
+ 所有适配器都支持以下标准调用方式:
272
+
273
+ 1. 指定类型和ID: `To(type,id).Func()`
274
+ ```python
275
+ await adapter.AdapterName.To("user", "U1001").Text("Hello")
276
+ ```
277
+ 2. 仅指定ID: `To(id).Func()`
278
+ ```python
279
+ await adapter.AdapterName.To("U1001").Text("Hello")
280
+ ```
281
+ 3. 指定发送账号: `Using(account_id)`
282
+ ```python
283
+ await adapter.AdapterName.Using("bot1").To("U1001").Text("Hello")
284
+ ```
285
+ 4. 直接调用: `Func()`
286
+ ```python
287
+ await adapter.AdapterName.Text("Broadcast message")
288
+ ```
289
+
290
+ ### 事件监听
291
+ 有两种事件监听方式:
292
+
293
+ 1. 平台原生事件监听:
294
+ ```python
295
+ @adapter.AdapterName.on("event_type")
296
+ async def handler(data):
297
+ print(f"收到原生事件: {data}")
298
+ ```
299
+
300
+ 2. OneBot12标准事件监听:
301
+ ```python
302
+ @adapter.on("event_type") # 所有平台的标准事件
303
+ async def handler(data):
304
+ if data["platform"] == "yunhu":
305
+ print(f"收到云湖标准事件: {data}")
306
+ ```
307
+
308
+ ---
309
+
267
310
  ## 标准格式
268
311
  为方便参考,这里给出了简单的事件格式,如果需要详细信息,请参考上方的链接。
269
312
 
@@ -691,7 +734,7 @@ ErisPulse 项目:
691
734
 
692
735
  # 📦 `ErisPulse.Core.adapter` 模块
693
736
 
694
- *自动生成于 2025-07-17 16:39:14*
737
+ *自动生成于 2025-07-17 16:57:03*
695
738
 
696
739
  ---
697
740
 
@@ -1036,13 +1079,13 @@ OneBot12协议事件监听装饰器
1036
1079
  ---
1037
1080
 
1038
1081
 
1039
- *文档最后更新于 2025-07-17 16:39:14*
1082
+ *文档最后更新于 2025-07-17 16:57:03*
1040
1083
 
1041
1084
  ## env.md
1042
1085
 
1043
1086
  # 📦 `ErisPulse.Core.env` 模块
1044
1087
 
1045
- *自动生成于 2025-07-17 16:39:14*
1088
+ *自动生成于 2025-07-17 16:57:03*
1046
1089
 
1047
1090
  ---
1048
1091
 
@@ -1328,13 +1371,13 @@ ErisPulse 环境配置模块
1328
1371
  ---
1329
1372
 
1330
1373
 
1331
- *文档最后更新于 2025-07-17 16:39:14*
1374
+ *文档最后更新于 2025-07-17 16:57:03*
1332
1375
 
1333
1376
  ## logger.md
1334
1377
 
1335
1378
  # 📦 `ErisPulse.Core.logger` 模块
1336
1379
 
1337
- *自动生成于 2025-07-17 16:39:14*
1380
+ *自动生成于 2025-07-17 16:57:03*
1338
1381
 
1339
1382
  ---
1340
1383
 
@@ -1416,13 +1459,13 @@ ErisPulse 日志系统
1416
1459
  ---
1417
1460
 
1418
1461
 
1419
- *文档最后更新于 2025-07-17 16:39:14*
1462
+ *文档最后更新于 2025-07-17 16:57:03*
1420
1463
 
1421
1464
  ## mods.md
1422
1465
 
1423
1466
  # 📦 `ErisPulse.Core.mods` 模块
1424
1467
 
1425
- *自动生成于 2025-07-17 16:39:14*
1468
+ *自动生成于 2025-07-17 16:57:03*
1426
1469
 
1427
1470
  ---
1428
1471
 
@@ -1605,13 +1648,13 @@ ErisPulse 模块管理器
1605
1648
  ---
1606
1649
 
1607
1650
 
1608
- *文档最后更新于 2025-07-17 16:39:14*
1651
+ *文档最后更新于 2025-07-17 16:57:03*
1609
1652
 
1610
1653
  ## raiserr.md
1611
1654
 
1612
1655
  # 📦 `ErisPulse.Core.raiserr` 模块
1613
1656
 
1614
- *自动生成于 2025-07-17 16:39:14*
1657
+ *自动生成于 2025-07-17 16:57:03*
1615
1658
 
1616
1659
  ---
1617
1660
 
@@ -1715,13 +1758,13 @@ ErisPulse 错误管理系统
1715
1758
  ---
1716
1759
 
1717
1760
 
1718
- *文档最后更新于 2025-07-17 16:39:14*
1761
+ *文档最后更新于 2025-07-17 16:57:03*
1719
1762
 
1720
1763
  ## server.md
1721
1764
 
1722
1765
  # 📦 `ErisPulse.Core.server` 模块
1723
1766
 
1724
- *自动生成于 2025-07-17 16:39:14*
1767
+ *自动生成于 2025-07-17 16:57:03*
1725
1768
 
1726
1769
  ---
1727
1770
 
@@ -1842,13 +1885,13 @@ ErisPulse Adapter Server
1842
1885
  ---
1843
1886
 
1844
1887
 
1845
- *文档最后更新于 2025-07-17 16:39:14*
1888
+ *文档最后更新于 2025-07-17 16:57:03*
1846
1889
 
1847
1890
  ## util.md
1848
1891
 
1849
1892
  # 📦 `ErisPulse.Core.util` 模块
1850
1893
 
1851
- *自动生成于 2025-07-17 16:39:14*
1894
+ *自动生成于 2025-07-17 16:57:03*
1852
1895
 
1853
1896
  ---
1854
1897
 
@@ -1942,6 +1985,6 @@ ErisPulse 工具函数集合
1942
1985
  ---
1943
1986
 
1944
1987
 
1945
- *文档最后更新于 2025-07-17 16:39:14*
1988
+ *文档最后更新于 2025-07-17 16:57:03*
1946
1989
 
1947
1990
  <!--- End of API文档 -->
@@ -258,6 +258,7 @@ util.ExecAsync(sync_task)
258
258
  > 基线协议:(OneBot12)[https://12.onebot.dev/]
259
259
  >
260
260
  > 本文档为**快速使用指南**,包含:
261
+ > - 通用接口使用方法
261
262
  > - 各适配器支持的Send方法链式调用示例
262
263
  > - 平台特有的事件/消息格式说明
263
264
  >
@@ -268,6 +269,48 @@ util.ExecAsync(sync_task)
268
269
 
269
270
  ---
270
271
 
272
+ ## 通用接口
273
+
274
+ ### Send 链式调用
275
+ 所有适配器都支持以下标准调用方式:
276
+
277
+ 1. 指定类型和ID: `To(type,id).Func()`
278
+ ```python
279
+ await adapter.AdapterName.To("user", "U1001").Text("Hello")
280
+ ```
281
+ 2. 仅指定ID: `To(id).Func()`
282
+ ```python
283
+ await adapter.AdapterName.To("U1001").Text("Hello")
284
+ ```
285
+ 3. 指定发送账号: `Using(account_id)`
286
+ ```python
287
+ await adapter.AdapterName.Using("bot1").To("U1001").Text("Hello")
288
+ ```
289
+ 4. 直接调用: `Func()`
290
+ ```python
291
+ await adapter.AdapterName.Text("Broadcast message")
292
+ ```
293
+
294
+ ### 事件监听
295
+ 有两种事件监听方式:
296
+
297
+ 1. 平台原生事件监听:
298
+ ```python
299
+ @adapter.AdapterName.on("event_type")
300
+ async def handler(data):
301
+ print(f"收到原生事件: {data}")
302
+ ```
303
+
304
+ 2. OneBot12标准事件监听:
305
+ ```python
306
+ @adapter.on("event_type") # 所有平台的标准事件
307
+ async def handler(data):
308
+ if data["platform"] == "yunhu":
309
+ print(f"收到云湖标准事件: {data}")
310
+ ```
311
+
312
+ ---
313
+
271
314
  ## 标准格式
272
315
  为方便参考,这里给出了简单的事件格式,如果需要详细信息,请参考上方的链接。
273
316
 
@@ -911,12 +954,14 @@ class MyAdapter(BaseAdapter):
911
954
 
912
955
  class Send(BaseAdapter.Send): # 继承BaseAdapter内置的Send类
913
956
  """
914
- Send消息发送DSL,支持三种调用方式(继承的Send类包含了To方法,它会在用户调用时自动设置以下属性):
957
+ Send消息发送DSL,支持四种调用方式(继承的Send类包含了To和Using方法):
915
958
  1. 指定类型和ID: To(type,id).Func() -> 设置_target_type和_target_id/_target_to
916
959
  示例: Send.To("group",123).Text("hi")
917
- 2. 仅指定ID: To(id).Func() -> 只设置_target_id/_target_to
918
- 示例: Send.To("user@mail.com").Text("hi")
919
- 3. 直接调用: Func() -> 不设置目标属性
960
+ 2. 指定发送账号: Using(account_id).Func() -> 设置_account_id
961
+ 示例: Send.Using("bot1").Text("hi")
962
+ 3. 组合使用: Using(account_id).To(type,id).Func()
963
+ 示例: Send.Using("bot1").To("user","123").Text("hi")
964
+ 4. 直接调用: Func() -> 不设置目标属性
920
965
  示例: Send.Text("broadcast")
921
966
  """
922
967
 
@@ -1001,12 +1046,30 @@ class Send((BaseAdapter.Send):
1001
1046
  )
1002
1047
  ```
1003
1048
 
1004
- 调用方式如下:
1049
+ 调用方式支持以下组合:
1050
+
1051
+ 1. 指定发送账号和接收目标:
1052
+ ```python
1053
+ sdk.adapter.MyPlatform.Send.Using("bot1").To("user", "U1001").Text("你好")
1054
+ ```
1005
1055
 
1056
+ 2. 仅指定接收目标:
1006
1057
  ```python
1007
1058
  sdk.adapter.MyPlatform.Send.To("user", "U1001").Text("你好")
1008
1059
  ```
1009
1060
 
1061
+ 3. 仅指定发送账号:
1062
+ ```python
1063
+ sdk.adapter.MyPlatform.Send.Using("bot1").Text("广播消息")
1064
+ ```
1065
+
1066
+ 4. 直接调用:
1067
+ ```python
1068
+ sdk.adapter.MyPlatform.Send.Text("广播消息")
1069
+ ```
1070
+
1071
+ `Using`方法用于指定发送账号,会设置`self._account_id`属性,可以在后续API调用中使用。
1072
+
1010
1073
  ---
1011
1074
 
1012
1075
  ## 5. 事件转换与路由注册
@@ -1576,7 +1639,7 @@ def generate_message_id(platform: str, raw_id: str) -> str:
1576
1639
 
1577
1640
  # 📦 `ErisPulse.__init__` 模块
1578
1641
 
1579
- *自动生成于 2025-07-17 16:39:14*
1642
+ *自动生成于 2025-07-17 16:57:03*
1580
1643
 
1581
1644
  ---
1582
1645
 
@@ -1907,13 +1970,13 @@ SDK初始化入口
1907
1970
  ---
1908
1971
 
1909
1972
 
1910
- *文档最后更新于 2025-07-17 16:39:14*
1973
+ *文档最后更新于 2025-07-17 16:57:03*
1911
1974
 
1912
1975
  ## ErisPulse\__main__.md
1913
1976
 
1914
1977
  # 📦 `ErisPulse.__main__` 模块
1915
1978
 
1916
- *自动生成于 2025-07-17 16:39:14*
1979
+ *自动生成于 2025-07-17 16:57:03*
1917
1980
 
1918
1981
  ---
1919
1982
 
@@ -2102,13 +2165,13 @@ PyPI包管理器
2102
2165
  ---
2103
2166
 
2104
2167
 
2105
- *文档最后更新于 2025-07-17 16:39:14*
2168
+ *文档最后更新于 2025-07-17 16:57:03*
2106
2169
 
2107
2170
  ## ErisPulse\Core\adapter.md
2108
2171
 
2109
2172
  # 📦 `ErisPulse.Core.adapter` 模块
2110
2173
 
2111
- *自动生成于 2025-07-17 16:39:14*
2174
+ *自动生成于 2025-07-17 16:57:03*
2112
2175
 
2113
2176
  ---
2114
2177
 
@@ -2453,13 +2516,13 @@ OneBot12协议事件监听装饰器
2453
2516
  ---
2454
2517
 
2455
2518
 
2456
- *文档最后更新于 2025-07-17 16:39:14*
2519
+ *文档最后更新于 2025-07-17 16:57:03*
2457
2520
 
2458
2521
  ## ErisPulse\Core\env.md
2459
2522
 
2460
2523
  # 📦 `ErisPulse.Core.env` 模块
2461
2524
 
2462
- *自动生成于 2025-07-17 16:39:14*
2525
+ *自动生成于 2025-07-17 16:57:03*
2463
2526
 
2464
2527
  ---
2465
2528
 
@@ -2745,13 +2808,13 @@ ErisPulse 环境配置模块
2745
2808
  ---
2746
2809
 
2747
2810
 
2748
- *文档最后更新于 2025-07-17 16:39:14*
2811
+ *文档最后更新于 2025-07-17 16:57:03*
2749
2812
 
2750
2813
  ## ErisPulse\Core\logger.md
2751
2814
 
2752
2815
  # 📦 `ErisPulse.Core.logger` 模块
2753
2816
 
2754
- *自动生成于 2025-07-17 16:39:14*
2817
+ *自动生成于 2025-07-17 16:57:03*
2755
2818
 
2756
2819
  ---
2757
2820
 
@@ -2833,13 +2896,13 @@ ErisPulse 日志系统
2833
2896
  ---
2834
2897
 
2835
2898
 
2836
- *文档最后更新于 2025-07-17 16:39:14*
2899
+ *文档最后更新于 2025-07-17 16:57:03*
2837
2900
 
2838
2901
  ## ErisPulse\Core\mods.md
2839
2902
 
2840
2903
  # 📦 `ErisPulse.Core.mods` 模块
2841
2904
 
2842
- *自动生成于 2025-07-17 16:39:14*
2905
+ *自动生成于 2025-07-17 16:57:03*
2843
2906
 
2844
2907
  ---
2845
2908
 
@@ -3022,13 +3085,13 @@ ErisPulse 模块管理器
3022
3085
  ---
3023
3086
 
3024
3087
 
3025
- *文档最后更新于 2025-07-17 16:39:14*
3088
+ *文档最后更新于 2025-07-17 16:57:03*
3026
3089
 
3027
3090
  ## ErisPulse\Core\raiserr.md
3028
3091
 
3029
3092
  # 📦 `ErisPulse.Core.raiserr` 模块
3030
3093
 
3031
- *自动生成于 2025-07-17 16:39:14*
3094
+ *自动生成于 2025-07-17 16:57:03*
3032
3095
 
3033
3096
  ---
3034
3097
 
@@ -3132,13 +3195,13 @@ ErisPulse 错误管理系统
3132
3195
  ---
3133
3196
 
3134
3197
 
3135
- *文档最后更新于 2025-07-17 16:39:14*
3198
+ *文档最后更新于 2025-07-17 16:57:03*
3136
3199
 
3137
3200
  ## ErisPulse\Core\server.md
3138
3201
 
3139
3202
  # 📦 `ErisPulse.Core.server` 模块
3140
3203
 
3141
- *自动生成于 2025-07-17 16:39:14*
3204
+ *自动生成于 2025-07-17 16:57:03*
3142
3205
 
3143
3206
  ---
3144
3207
 
@@ -3259,13 +3322,13 @@ ErisPulse Adapter Server
3259
3322
  ---
3260
3323
 
3261
3324
 
3262
- *文档最后更新于 2025-07-17 16:39:14*
3325
+ *文档最后更新于 2025-07-17 16:57:03*
3263
3326
 
3264
3327
  ## ErisPulse\Core\util.md
3265
3328
 
3266
3329
  # 📦 `ErisPulse.Core.util` 模块
3267
3330
 
3268
- *自动生成于 2025-07-17 16:39:14*
3331
+ *自动生成于 2025-07-17 16:57:03*
3269
3332
 
3270
3333
  ---
3271
3334
 
@@ -3359,6 +3422,6 @@ ErisPulse 工具函数集合
3359
3422
  ---
3360
3423
 
3361
3424
 
3362
- *文档最后更新于 2025-07-17 16:39:14*
3425
+ *文档最后更新于 2025-07-17 16:57:03*
3363
3426
 
3364
3427
  <!--- End of API文档 -->