Closed ElainaFanBoy closed 1 year ago
我自己用的项目结构比较旧了,仅供参考
import nonebot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter(ONEBOT_V11Adapter)
+ if __name__ == "__mp_main__":
+ nonebot.load_plugins("src/plugins")
if __name__ == "__main__":
+ nonebot.load_plugin("nonebot_plugin_reboot")
nonebot.run()
使用 pyproject.toml 的版本
import nonebot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter(ONEBOT_V11Adapter)
if __name__ == "__mp_main__":
nonebot.load_from_toml("pyproject.toml")
if __name__ == "__main__":
nonebot.load_plugin("nonebot_plugin_reboot")
nonebot.run()
大佬,可否请教一下bot.py点具体写法,我没有pyproject.toml,只靠文件夹加载插件