refactor: reloader 并入 auto_update 自动安装
This commit is contained in:
1 parent
a68ae28960
commit
47cb288e69
3 files changed
+111
-104
No files matched your search
@@ -1,19 +1,15 @@
|
||||
"""机器人入口
|
||||
|
||||
两种启动方式:
|
||||
- 开发调试:nb run --reload (文件变化自动重载,不走本入口)
|
||||
- 正式运行:python bot.py (监督进程模式,auto_update 插件拉取更新后可优雅重启)
|
||||
"""
|
||||
|
||||
import nonebot
|
||||
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
|
||||
|
||||
nonebot.init()
|
||||
|
||||
nonebot.load_from_toml("pyproject.toml") # 适配器 + 第三方插件 + 本地插件目录
|
||||
driver = nonebot.get_driver()
|
||||
driver.register_adapter(ONEBOT_V11Adapter)
|
||||
|
||||
from src.plugins.auto_update.reloader import install_reloader
|
||||
nonebot.load_builtin_plugins("echo")
|
||||
|
||||
install_reloader()
|
||||
|
||||
nonebot.load_from_toml("pyproject.toml")
|
||||
|
||||
if __name__ == "__main__":
|
||||
nonebot.run()
|
||||
Reference in new issue
Block a user