-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
What happened / 发生了什么
当载入插件出现错误的时候(例如RuntimeError),如果修复错误后点击“尝试一键重载插件”,修改后的插件没有被正确加载,重载仍然失败。
Reproduce / 如何复现?
例如,构建一个插件的初始化方法:
def __init__(self, context: Context):
super().__init__(context)
raise RuntimeError("这是一个人为错误")载入插件报错:
但是如果把raise error去掉保存代码,点击“尝试一键重载所有插件”,这个报错信息没有改变,说明新的插件信息没有正确被获取
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
4.18.2 手动部署
OS
Windows
Logs / 报错日志
[2026-02-25 20:59:08.170] [Core] [INFO] [star.star_manager:524]: 正在载入插件 astrbot_plugin_import_test ...
[2026-02-25 20:59:08.171] [Core] [DBUG] [star.star_manager:685]: 插件 data.plugins.astrbot_plugin_import_test.main 未通过装饰器注册。尝试通过旧版本方式载入。
[2026-02-25 20:59:08.171] [Core] [ERRO] [v4.18.2] [star.star_manager:803]: ----- 插件 astrbot_plugin_import_test 载入失败 -----
[2026-02-25 20:59:08.173] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | Traceback (most recent call last):
[2026-02-25 20:59:08.174] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | File "C:\Users\53219\Desktop\bottest\AstrBot-master\astrbot\core\star\star_manager.py", line 703, in load
[2026-02-25 20:59:08.174] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | obj = getattr(module, classes[0])(
[2026-02-25 20:59:08.175] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2026-02-25 20:59:08.175] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | File "C:\Users\53219\Desktop\bottest\AstrBot-master\data\plugins\astrbot_plugin_import_test\main.py", line 9, in init
[2026-02-25 20:59:08.176] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | #raise RuntimeError("这是一个人为错误")
[2026-02-25 20:59:08.176] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2026-02-25 20:59:08.177] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: | RuntimeError: 这是一个人为错误
[2026-02-25 20:59:08.177] [Core] [ERRO] [v4.18.2] [star.star_manager:806]: |
[2026-02-25 20:59:08.178] [Core] [ERRO] [v4.18.2] [star.star_manager:807]: ----------------------------------
Are you willing to submit a PR? / 你愿意提交 PR 吗?
- Yes!
Code of Conduct
- I have read and agree to abide by the project's Code of Conduct。