镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Open

Description

@Chzxxuanzheng

Image

Activity

  1. yanyongyu commented on May 27, 2025

    @yanyongyu
    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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions