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 add_dependency(*dependencies)

method update_dependency(*dependencies)

method remove_dependency(*dependencies)

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)

  • 参数

  • 返回

    • None

staticmethod remove_plugin(ctx, plugin)

  • 参数

  • 返回

    • 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