ErisPulse 2.3.3__py3-none-any.whl → 2.3.4.dev0__py3-none-any.whl

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 (76) hide show
  1. ErisPulse/Core/Event/wrapper.py +2 -3
  2. ErisPulse/Core/Event/wrapper.pyi +2 -3
  3. ErisPulse/Core/__init__.py +0 -5
  4. ErisPulse/Core/__init__.pyi +0 -1
  5. ErisPulse/__init__.py +0 -4
  6. ErisPulse/__init__.pyi +0 -1
  7. ErisPulse/sdk_protocol.py +0 -7
  8. ErisPulse/sdk_protocol.pyi +0 -3
  9. ErisPulse/utils/__init__.py +1 -1
  10. ErisPulse/utils/cli/__init__.py +11 -0
  11. ErisPulse/utils/cli/__init__.pyi +13 -0
  12. ErisPulse/utils/cli/__main__.py +225 -0
  13. ErisPulse/utils/cli/__main__.pyi +81 -0
  14. ErisPulse/utils/cli/base.py +52 -0
  15. ErisPulse/utils/cli/base.pyi +50 -0
  16. ErisPulse/utils/cli/commands/__init__.py +6 -0
  17. ErisPulse/utils/cli/commands/__init__.pyi +12 -0
  18. ErisPulse/utils/cli/commands/init.py +400 -0
  19. ErisPulse/utils/cli/commands/init.pyi +82 -0
  20. ErisPulse/utils/cli/commands/install.py +307 -0
  21. ErisPulse/utils/cli/commands/install.pyi +70 -0
  22. ErisPulse/utils/cli/commands/list.py +165 -0
  23. ErisPulse/utils/cli/commands/list.pyi +56 -0
  24. ErisPulse/utils/cli/commands/list_remote.py +128 -0
  25. ErisPulse/utils/cli/commands/list_remote.pyi +47 -0
  26. ErisPulse/utils/cli/commands/run.py +112 -0
  27. ErisPulse/utils/cli/commands/run.pyi +48 -0
  28. ErisPulse/utils/cli/commands/self_update.py +237 -0
  29. ErisPulse/utils/cli/commands/self_update.pyi +59 -0
  30. ErisPulse/utils/cli/commands/uninstall.py +37 -0
  31. ErisPulse/utils/cli/commands/uninstall.pyi +37 -0
  32. ErisPulse/utils/cli/commands/upgrade.py +62 -0
  33. ErisPulse/utils/cli/commands/upgrade.pyi +38 -0
  34. ErisPulse/utils/cli/registry.py +112 -0
  35. ErisPulse/utils/cli/registry.pyi +99 -0
  36. {erispulse-2.3.3.dist-info → erispulse-2.3.4.dev0.dist-info}/METADATA +6 -20
  37. erispulse-2.3.4.dev0.dist-info/RECORD +89 -0
  38. {erispulse-2.3.3.dist-info → erispulse-2.3.4.dev0.dist-info}/licenses/LICENSE +3 -3
  39. ErisPulse/Core/ux.py +0 -635
  40. ErisPulse/Core/ux.pyi +0 -94
  41. ErisPulse/utils/cli.py +0 -1097
  42. ErisPulse/utils/cli.pyi +0 -145
  43. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Bases/__init__.pyi +0 -14
  44. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Bases/adapter.pyi +0 -140
  45. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Bases/module.pyi +0 -52
  46. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/__init__.pyi +0 -26
  47. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/base.pyi +0 -62
  48. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/command.pyi +0 -113
  49. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/exceptions.pyi +0 -43
  50. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/message.pyi +0 -93
  51. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/meta.pyi +0 -92
  52. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/notice.pyi +0 -108
  53. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/request.pyi +0 -76
  54. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/Event/wrapper.pyi +0 -404
  55. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/__init__.pyi +0 -17
  56. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/_self_config.pyi +0 -72
  57. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/adapter.pyi +0 -229
  58. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/config.pyi +0 -70
  59. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/exceptions.pyi +0 -60
  60. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/lifecycle.pyi +0 -92
  61. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/logger.pyi +0 -168
  62. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/module.pyi +0 -178
  63. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/router.pyi +0 -120
  64. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/storage.pyi +0 -273
  65. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/Core/ux.pyi +0 -94
  66. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/__init__.pyi +0 -310
  67. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/__main__.pyi +0 -24
  68. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/sdk_protocol.pyi +0 -100
  69. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/utils/__init__.pyi +0 -16
  70. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/utils/cli.pyi +0 -145
  71. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/utils/console.pyi +0 -20
  72. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/utils/package_manager.pyi +0 -224
  73. erispulse-2.3.3.data/data/ErisPulse-stubs/ErisPulse/utils/reload_handler.pyi +0 -64
  74. erispulse-2.3.3.dist-info/RECORD +0 -98
  75. {erispulse-2.3.3.dist-info → erispulse-2.3.4.dev0.dist-info}/WHEEL +0 -0
  76. {erispulse-2.3.3.dist-info → erispulse-2.3.4.dev0.dist-info}/entry_points.txt +0 -0
ErisPulse/utils/cli.pyi DELETED
@@ -1,145 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for cli.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- import argparse
8
- import importlib.metadata
9
- import sys
10
- import os
11
- import time
12
- import asyncio
13
- from typing import List, Dict, Optional, Any
14
- from watchdog.observers import Observer
15
- from rich.panel import Panel
16
- from rich.table import Table
17
- from rich.prompt import Confirm, Prompt
18
- from rich.box import SIMPLE
19
- from .console import console
20
-
21
- class CLI:
22
- """
23
- ErisPulse命令行接口
24
-
25
- 提供完整的命令行交互功能
26
-
27
- {!--< tips >!--}
28
- 1. 支持动态加载第三方命令
29
- 2. 支持模块化子命令系统
30
- {!--< /tips >!--}
31
- """
32
- def __init__(self: None) -> ...:
33
- """
34
- 初始化CLI
35
- """
36
- ...
37
- def _create_parser(self: object) -> argparse.ArgumentParser:
38
- """
39
- 创建命令行参数解析器
40
-
41
- :return: 配置好的ArgumentParser实例
42
- """
43
- ...
44
- def _get_external_commands(self: object) -> List[str]:
45
- """
46
- 获取所有已注册的第三方命令名称
47
-
48
- :return: 第三方命令名称列表
49
- """
50
- ...
51
- def _load_external_commands(self: object, subparsers: ...) -> ...:
52
- """
53
- 加载第三方CLI命令
54
-
55
- :param subparsers: 子命令解析器
56
-
57
- :raises ImportError: 加载命令失败时抛出
58
- """
59
- ...
60
- def _print_version(self: object) -> ...:
61
- """
62
- 打印版本信息
63
- """
64
- ...
65
- def _print_installed_packages(self: object, pkg_type: str, outdated_only: bool = ...) -> ...:
66
- """
67
- 打印已安装包信息
68
-
69
- :param pkg_type: 包类型 (modules/adapters/cli/all)
70
- :param outdated_only: 是否只显示可升级的包
71
- """
72
- ...
73
- def _print_remote_packages(self: object, pkg_type: str) -> ...:
74
- """
75
- 打印远程包信息
76
-
77
- :param pkg_type: 包类型 (modules/adapters/cli/all)
78
- """
79
- ...
80
- def _is_package_outdated(self: object, package_name: str, current_version: str) -> bool:
81
- """
82
- 检查包是否过时
83
-
84
- :param package_name: 包名
85
- :param current_version: 当前版本
86
- :return: 是否有新版本可用
87
- """
88
- ...
89
- def _resolve_package_name(self: object, short_name: str) -> Optional[str]:
90
- """
91
- 解析简称到完整包名(大小写不敏感)
92
-
93
- :param short_name: 模块/适配器简称
94
- :return: 完整包名,未找到返回None
95
- """
96
- ...
97
- def _print_search_results(self: object, query: str, results: Dict[(str, List[Dict[(str, str)]])]) -> ...:
98
- """
99
- 打印搜索结果
100
-
101
- :param query: 搜索关键词
102
- :param results: 搜索结果
103
- """
104
- ...
105
- def _print_version_list(self: object, versions: List[Dict[(str, Any)]], include_pre: bool = ...) -> ...:
106
- """
107
- 打印版本列表
108
-
109
- :param versions: 版本信息列表
110
- :param include_pre: 是否包含预发布版本
111
- """
112
- ...
113
- def _setup_watchdog(self: object, script_path: str, reload_mode: bool) -> ...:
114
- """
115
- 设置文件监控
116
-
117
- :param script_path: 要监控的脚本路径
118
- :param reload_mode: 是否启用重载模式
119
- """
120
- ...
121
- def _cleanup(self: object) -> ...:
122
- """
123
- 清理资源
124
- """
125
- ...
126
- def run(self: object) -> ...:
127
- """
128
- 运行CLI
129
-
130
- :raises KeyboardInterrupt: 用户中断时抛出
131
- :raises Exception: 命令执行失败时抛出
132
- """
133
- ...
134
-
135
- def _cleanup_adapters() -> ...:
136
- """
137
- 清理适配器资源
138
- """
139
- ...
140
-
141
- def _cleanup_modules() -> ...:
142
- """
143
- 清理模块资源
144
- """
145
- ...
@@ -1,14 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for __init__.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 基础模块
9
-
10
- 提供核心基类定义,包括适配器和模块基类
11
- """
12
-
13
- from .adapter import SendDSL, BaseAdapter
14
- from .module import BaseModule
@@ -1,140 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for adapter.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 适配器基础模块
9
-
10
- 提供适配器和消息发送DSL的基类实现
11
-
12
- {!--< tips >!--}
13
- 1. 用于实现与不同平台的交互接口
14
- 2. 提供统一的消息发送DSL风格接口
15
- {!--< /tips >!--}
16
- """
17
-
18
- import asyncio
19
- from typing import Any, Optional, Union, Awaitable
20
-
21
- class SendDSL:
22
- """
23
- 消息发送DSL基类
24
-
25
- 用于实现 Send.To(...).Func(...) 风格的链式调用接口
26
-
27
- {!--< tips >!--}
28
- 1. 子类应实现具体的消息发送方法(如Text, Image等)
29
- 2. 通过__getattr__实现动态方法调用
30
- {!--< /tips >!--}
31
- """
32
- def __init__(self: None, adapter: BaseAdapter, target_type: Optional[str] = ..., target_id: Optional[str] = ..., account_id: Optional[str] = ...) -> ...:
33
- """
34
- 初始化DSL发送器
35
-
36
- :param adapter: 所属适配器实例
37
- :param target_type: 目标类型(可选)
38
- :param target_id: 目标ID(可选)
39
- :param _account_id: 发送账号(可选)
40
- """
41
- ...
42
- def To(self: object, target_type: str = ..., target_id: Union[(str, int)] = ...) -> SendDSL:
43
- """
44
- 设置消息目标
45
-
46
- :param target_type: 目标类型(可选)
47
- :param target_id: 目标ID(可选)
48
- :return: SendDSL实例
49
-
50
- :example:
51
- >>> adapter.Send.To("user", "123").Text("Hello")
52
- >>> adapter.Send.To("123").Text("Hello") # 简化形式
53
- """
54
- ...
55
- def Using(self: object, account_id: Union[(str, int)]) -> SendDSL:
56
- """
57
- 设置发送账号
58
-
59
- :param _account_id: 发送账号
60
- :return: SendDSL实例
61
-
62
- :example:
63
- >>> adapter.Send.Using("bot1").To("123").Text("Hello")
64
- >>> adapter.Send.To("123").Using("bot1").Text("Hello") # 支持乱序
65
- """
66
- ...
67
- def Account(self: object, account_id: Union[(str, int)]) -> SendDSL:
68
- """
69
- 设置发送账号
70
-
71
- :param _account_id: 发送账号
72
- :return: SendDSL实例
73
-
74
- :example:
75
- >>> adapter.Send.Account("bot1").To("123").Text("Hello")
76
- >>> adapter.Send.To("123").Account("bot1").Text("Hello") # 支持乱序
77
- """
78
- ...
79
-
80
- class BaseAdapter:
81
- """
82
- 适配器基类
83
-
84
- 提供与外部平台交互的标准接口,子类必须实现必要方法
85
-
86
- {!--< tips >!--}
87
- 1. 必须实现call_api, start和shutdown方法
88
- 2. 可以自定义Send类实现平台特定的消息发送逻辑
89
- 3. 通过on装饰器注册事件处理器
90
- 4. 支持OneBot12协议的事件处理
91
- {!--< /tips >!--}
92
- """
93
- def __init__(self: None) -> ...:
94
- ...
95
- async def call_api(self: object, endpoint: str, **params: Any) -> Any:
96
- """
97
- 调用平台API的抽象方法
98
-
99
- :param endpoint: API端点
100
- :param params: API参数
101
- :return: API调用结果
102
- :raises NotImplementedError: 必须由子类实现
103
- """
104
- ...
105
- async def start(self: object) -> None:
106
- """
107
- 启动适配器的抽象方法
108
-
109
- :raises NotImplementedError: 必须由子类实现
110
- """
111
- ...
112
- async def shutdown(self: object) -> None:
113
- """
114
- 关闭适配器的抽象方法
115
-
116
- :raises NotImplementedError: 必须由子类实现
117
- """
118
- ...
119
- async def emit(self: object) -> None:
120
- ...
121
- def send(self: object, target_type: str, target_id: str, message: Any, **kwargs: Any) -> asyncio.Task:
122
- """
123
- 发送消息的便捷方法,返回一个 asyncio Task
124
-
125
- :param target_type: 目标类型
126
- :param target_id: 目标ID
127
- :param message: 消息内容
128
- :param kwargs: 其他参数
129
- - method: 发送方法名(默认为"Text")
130
- :return: asyncio.Task 对象,用户可以自主决定是否等待
131
-
132
- :raises AttributeError: 当发送方法不存在时抛出
133
-
134
- :example:
135
- >>> task = adapter.send("user", "123", "Hello")
136
- >>> # 用户可以选择等待: result = await task
137
- >>> # 或者不等待让其在后台执行
138
- >>> await adapter.send("group", "456", "Hello", method="Markdown") # 直接等待
139
- """
140
- ...
@@ -1,52 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for module.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 模块基础模块
9
-
10
- 提供模块基类定义和标准接口
11
- """
12
-
13
- class BaseModule:
14
- """
15
- 模块基类
16
-
17
- 提供模块加载和卸载的标准接口
18
- """
19
- def should_eager_load() -> bool:
20
- """
21
- 模块是否应该在启动时加载
22
- 默认为False(即懒加载)
23
-
24
- :return: 是否应该在启动时加载
25
- """
26
- ...
27
- async def on_load(self: object, event: dict) -> bool:
28
- """
29
- 当模块被加载时调用
30
-
31
- :param event: 事件内容
32
- :return: 处理结果
33
-
34
- {!--< tips >!--}
35
- 其中,event事件内容为:
36
- `{ "module_name": "模块名" }`
37
- {!--< /tips >!--}
38
- """
39
- ...
40
- async def on_unload(self: object, event: dict) -> bool:
41
- """
42
- 当模块被卸载时调用
43
-
44
- :param event: 事件内容
45
- :return: 处理结果
46
-
47
- {!--< tips >!--}
48
- 其中,event事件内容为:
49
- `{ "module_name": "模块名" }`
50
- {!--< /tips >!--}
51
- """
52
- ...
@@ -1,26 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for __init__.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 事件处理模块
9
-
10
- 提供统一的事件处理接口,支持命令、消息、通知、请求和元事件处理
11
-
12
- {!--< tips >!--}
13
- 1. 所有事件处理都基于OneBot12标准事件格式
14
- 2. 通过装饰器方式注册事件处理器
15
- 3. 支持优先级和条件过滤
16
- {!--< /tips >!--}
17
- """
18
-
19
- from .command import command
20
- from .message import message
21
- from .notice import notice
22
- from .request import request
23
- from .meta import meta
24
- from .wrapper import Event
25
- from . import exceptions
26
- from .. import config
@@ -1,62 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for base.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 事件处理基础模块
9
-
10
- 提供事件处理的核心功能,包括事件注册和处理
11
-
12
- {!--< tips >!--}
13
- 1. 所有事件处理都基于OneBot12标准事件格式
14
- 2. 通过适配器系统进行事件分发和接收
15
- {!--< /tips >!--}
16
- """
17
-
18
- from .. import adapter, logger
19
- from typing import Callable, Any, Dict, List
20
- import asyncio
21
- from .wrapper import Event
22
-
23
- class BaseEventHandler:
24
- """
25
- 基础事件处理器
26
-
27
- 提供事件处理的基本功能,包括处理器注册和注销
28
- """
29
- def __init__(self: None, event_type: str, module_name: str = ...) -> ...:
30
- """
31
- 初始化事件处理器
32
-
33
- :param event_type: 事件类型
34
- :param module_name: 模块名称
35
- """
36
- ...
37
- def register(self: object, handler: Callable, priority: int = ..., condition: Callable = ...) -> ...:
38
- """
39
- 注册事件处理器
40
-
41
- :param handler: 事件处理器函数
42
- :param priority: 处理器优先级,数值越小优先级越高
43
- :param condition: 处理器条件函数,返回True时才会执行处理器
44
- """
45
- ...
46
- def unregister(self: object, handler: Callable) -> bool:
47
- """
48
- 注销事件处理器
49
-
50
- :param handler: 要注销的事件处理器
51
- :return: 是否成功注销
52
- """
53
- ...
54
- def __call__(self: object, priority: int = ..., condition: Callable = ...) -> ...:
55
- """
56
- 装饰器方式注册事件处理器
57
-
58
- :param priority: 处理器优先级
59
- :param condition: 处理器条件函数
60
- :return: 装饰器函数
61
- """
62
- ...
@@ -1,113 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for command.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 命令处理模块
9
-
10
- 提供基于装饰器的命令注册和处理功能
11
-
12
- {!--< tips >!--}
13
- 1. 支持命令别名和命令组
14
- 2. 支持命令权限控制
15
- 3. 支持命令帮助系统
16
- 4. 支持等待用户回复交互
17
- {!--< /tips >!--}
18
- """
19
-
20
- from .base import BaseEventHandler
21
- from .. import adapter, config, logger
22
- from typing import Callable, Union, List, Dict, Any, Optional, Awaitable
23
- import asyncio
24
-
25
- class CommandHandler:
26
- """
27
- 命令处理器
28
-
29
- 提供命令注册、处理和管理功能
30
- """
31
- def __init__(self: None) -> ...:
32
- ...
33
- def __call__(self: object, name: Union[(str, List[str])] = ..., aliases: List[str] = ..., group: str = ..., priority: int = ..., permission: Callable = ..., help: str = ..., usage: str = ..., hidden: bool = ...) -> ...:
34
- """
35
- 命令装饰器
36
-
37
- :param name: 命令名称,可以是字符串或字符串列表
38
- :param aliases: 命令别名列表
39
- :param group: 命令组名称
40
- :param priority: 处理器优先级
41
- :param permission: 权限检查函数,返回True时允许执行命令
42
- :param help: 命令帮助信息
43
- :param usage: 命令使用方法
44
- :param hidden: 是否在帮助中隐藏命令
45
- :return: 装饰器函数
46
- """
47
- ...
48
- def unregister(self: object, handler: Callable) -> bool:
49
- """
50
- 注销命令处理器
51
-
52
- :param handler: 要注销的命令处理器
53
- :return: 是否成功注销
54
- """
55
- ...
56
- async def wait_reply(self: object, event: Dict[(str, Any)], prompt: str = ..., timeout: float = ..., callback: Callable[([Dict[(str, Any)]], Awaitable[Any])] = ..., validator: Callable[([Dict[(str, Any)]], bool)] = ...) -> Optional[Dict[(str, Any)]]:
57
- """
58
- 等待用户回复
59
-
60
- :param event: 原始事件数据
61
- :param prompt: 提示消息,如果提供会发送给用户
62
- :param timeout: 等待超时时间(秒)
63
- :param callback: 回调函数,当收到回复时执行
64
- :param validator: 验证函数,用于验证回复是否有效
65
- :return: 用户回复的事件数据,如果超时则返回None
66
- """
67
- ...
68
- async def _check_pending_reply(self: object, event: Dict[(str, Any)]) -> ...:
69
- """
70
- 检查是否是等待回复的消息
71
-
72
- :param event: 消息事件数据
73
- """
74
- ...
75
- def get_command(self: object, name: str) -> Optional[Dict]:
76
- """
77
- 获取命令信息
78
-
79
- :param name: 命令名称
80
- :return: 命令信息字典,如果不存在则返回None
81
- """
82
- ...
83
- def get_commands(self: object) -> Dict[(str, Dict)]:
84
- """
85
- 获取所有命令
86
-
87
- :return: 命令信息字典
88
- """
89
- ...
90
- def get_group_commands(self: object, group: str) -> List[str]:
91
- """
92
- 获取命令组中的命令
93
-
94
- :param group: 命令组名称
95
- :return: 命令名称列表
96
- """
97
- ...
98
- def get_visible_commands(self: object) -> Dict[(str, Dict)]:
99
- """
100
- 获取所有可见命令(非隐藏命令)
101
-
102
- :return: 可见命令信息字典
103
- """
104
- ...
105
- def help(self: object, command_name: str = ..., show_hidden: bool = ...) -> str:
106
- """
107
- 生成帮助信息
108
-
109
- :param command_name: 命令名称,如果为None则生成所有命令的帮助
110
- :param show_hidden: 是否显示隐藏命令
111
- :return: 帮助信息字符串
112
- """
113
- ...
@@ -1,43 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for exceptions.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 事件系统异常处理模块
9
-
10
- 提供事件系统中可能发生的各种异常类型定义
11
- """
12
-
13
- class EventException(Exception):
14
- """
15
- 事件系统基础异常
16
-
17
- 所有事件系统相关异常的基类
18
- """
19
- ...
20
-
21
- class CommandException(EventException):
22
- """
23
- 命令处理异常
24
-
25
- 当命令处理过程中发生错误时抛出
26
- """
27
- ...
28
-
29
- class EventHandlerException(EventException):
30
- """
31
- 事件处理器异常
32
-
33
- 当事件处理器执行过程中发生错误时抛出
34
- """
35
- ...
36
-
37
- class EventNotFoundException(EventException):
38
- """
39
- 事件未找到异常
40
-
41
- 当尝试获取不存在的事件处理器时抛出
42
- """
43
- ...
@@ -1,93 +0,0 @@
1
- # type: ignore
2
- #
3
- # Auto-generated type stub for message.py
4
- # DO NOT EDIT MANUALLY - Generated by generate-type-stubs.py
5
- #
6
-
7
- """
8
- ErisPulse 消息处理模块
9
-
10
- 提供基于装饰器的消息事件处理功能
11
-
12
- {!--< tips >!--}
13
- 1. 支持私聊、群聊消息分类处理
14
- 2. 支持@消息特殊处理
15
- 3. 支持自定义条件过滤
16
- {!--< /tips >!--}
17
- """
18
-
19
- from .base import BaseEventHandler
20
- from typing import Callable, Dict, Any
21
-
22
- class MessageHandler:
23
- """
24
- 消息事件处理器
25
-
26
- 提供不同类型消息事件的处理功能
27
- """
28
- def __init__(self: None) -> ...:
29
- ...
30
- def on_message(self: object, priority: int = ...) -> ...:
31
- """
32
- 消息事件装饰器
33
-
34
- :param priority: 处理器优先级
35
- :return: 装饰器函数
36
- """
37
- ...
38
- def remove_message_handler(self: object, handler: Callable) -> bool:
39
- """
40
- 取消注册消息事件处理器
41
-
42
- :param handler: 要取消注册的处理器
43
- :return: 是否成功取消注册
44
- """
45
- ...
46
- def on_private_message(self: object, priority: int = ...) -> ...:
47
- """
48
- 私聊消息事件装饰器
49
-
50
- :param priority: 处理器优先级
51
- :return: 装饰器函数
52
- """
53
- ...
54
- def remove_private_message_handler(self: object, handler: Callable) -> bool:
55
- """
56
- 取消注册私聊消息事件处理器
57
-
58
- :param handler: 要取消注册的处理器
59
- :return: 是否成功取消注册
60
- """
61
- ...
62
- def on_group_message(self: object, priority: int = ...) -> ...:
63
- """
64
- 群聊消息事件装饰器
65
-
66
- :param priority: 处理器优先级
67
- :return: 装饰器函数
68
- """
69
- ...
70
- def remove_group_message_handler(self: object, handler: Callable) -> bool:
71
- """
72
- 取消注册群聊消息事件处理器
73
-
74
- :param handler: 要取消注册的处理器
75
- :return: 是否成功取消注册
76
- """
77
- ...
78
- def on_at_message(self: object, priority: int = ...) -> ...:
79
- """
80
- @消息事件装饰器
81
-
82
- :param priority: 处理器优先级
83
- :return: 装饰器函数
84
- """
85
- ...
86
- def remove_at_message_handler(self: object, handler: Callable) -> bool:
87
- """
88
- 取消注册@消息事件处理器
89
-
90
- :param handler: 要取消注册的处理器
91
- :return: 是否成功取消注册
92
- """
93
- ...