Skip to main content

nb_cli.config.parser

class ConfigManager(*, working_dir=None, python_path=None, use_venv=None, logger=None)​

  • 参数

    • working_dir (Path | None)

    • python_path (str | None)

    • use_venv (bool | None)

    • logger (logging.Logger | None)

method get_nonebot_config()​

method update_nonebot_config(config)​

method get_dependencies(*, group=None)​

  • 参数

    • group (str | None)
  • 返回

    • list[Requirement]

method add_dependency(*dependencies, group=None)​

  • 参数

    • *dependencies (str | PackageInfo | Requirement)

    • group (str | None)

  • 返回

    • None

method update_dependency(*dependencies)​

  • 参数

  • 返回

    • None

method remove_dependency(*dependencies)​

  • 说明: 删除依赖记录操作。

  • 参数

  • Returns

    • list[Requirement]: 成功完整移除的相关依赖。

method add_adapter(*adapters)​

method remove_adapter(adapter)​

  • 说明: 删除适配器操作。

  • 参数

  • Returns

    • bool: 表示是否可以执行卸载操作。

method add_plugin(*plugins)​

method remove_plugin(plugin)​

  • 说明: 删除插件操作。

  • 参数

  • Returns

    • bool: 表示是否可以执行卸载操作。

method add_builtin_plugin(plugin)​

  • 参数

    • plugin (str)
  • 返回

    • None

method remove_builtin_plugin(plugin)​

  • 参数

    • plugin (str)
  • 返回

    • None

class DefaultConfigPolicy(origin)​

  • 参数

    • origin (ConfigManager)

staticmethod test_format(cfg)​

  • 参数

    • cfg (dict[str, Any])
  • 返回

    • bool

method get_nonebot_config()​

staticmethod add_adapter(ctx, adapter)​

staticmethod remove_adapter(ctx, adapter)​

staticmethod add_plugin(ctx, plugin)​

  • 参数

    • ctx (dict[str, list[str]])

    • plugin (PackageInfo | str)

  • 返回

    • None

staticmethod remove_plugin(ctx, plugin)​

  • 参数

    • ctx (dict[str, list[str]])

    • plugin (PackageInfo | str)

  • 返回

    • bool

class LegacyConfigPolicy(origin)​

  • 参数

    • origin (ConfigManager)

staticmethod test_format(cfg)​

  • 参数

    • cfg (dict[str, Any])
  • 返回

    • bool

method get_nonebot_config()​

staticmethod add_adapter(ctx, adapter)​

  • 参数

  • 返回

    • None

staticmethod remove_adapter(ctx, adapter)​

  • 参数

  • 返回

    • bool

staticmethod add_plugin(ctx, plugin)​

  • 参数

  • 返回

    • None

staticmethod remove_plugin(ctx, plugin)​

  • 参数

  • 返回

    • bool