Skip to content

执行子模块时不会加载bot.py #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Chzxxuanzheng opened this issue May 27, 2025 · 1 comment
Open

执行子模块时不会加载bot.py #146

Chzxxuanzheng opened this issue May 27, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Chzxxuanzheng
Copy link

Image

@yanyongyu
Copy link
Member

目前不支持使用 bot.py 的情况下使用,你可以使用一个脚本来执行。

import sys
from pathlib import Path

root = Path(__file__).parent  # 注意此处为你的项目目录,即 bot.py 所在目录

sys.path.append(str(root))

import bot  # noqa: F401

# isort: split

from nonebot_plugin_orm.__main__ import main

if __name__ == "__main__":
    main()

@yanyongyu yanyongyu added the enhancement New feature or request label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants