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()
-
参数
empty
-
返回
method update_nonebot_config(config)
-
参数
config(NoneBotConfig | LegacyNoneBotConfig)
-
返回
- None
method get_dependencies()
-
参数
empty
-
返回
- list[Requirement]
method add_dependency(*dependencies)
-
参数
*dependencies(str | PackageInfo)
-
返回
- None
method update_dependency(*dependencies)
-
参数
*dependencies(PackageInfo)
-
返回
- None
method remove_dependency(*dependencies)
-
说明: 删除依赖记录操作。
-
参数
*dependencies(str | PackageInfo)
-
Returns
- bool: 表示相关依赖是否全部被成功移除。
method add_adapter(*adapters)
-
参数
*adapters(PackageInfo)
-
返回
- None
method remove_adapter(adapter)
-
说明: 删除适配器操作。
-
参数
adapter(PackageInfo)
-
Returns
- bool: 表示是否可以执行卸载操作。
method add_plugin(*plugins)
-
参数
*plugins(PackageInfo)
-
返回
- None
method remove_plugin(plugin)
-
说明: 删除插件操作。
-
参数
plugin(PackageInfo)
-
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()
-
参数
empty
-
返回
staticmethod add_adapter(ctx, adapter)
-
参数
-
ctx(dict[str, list[dict[str, str]]]) -
adapter(PackageInfo | SimpleInfo)
-
-
返回
- None
staticmethod remove_adapter(ctx, adapter)
-
参数
-
ctx(dict[str, list[dict[str, str]]]) -
adapter(PackageInfo | SimpleInfo)
-
-
返回
- bool
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()
-
参数
empty
-
返回
staticmethod add_adapter(ctx, adapter)
-
参数
-
ctx(list[dict[str, Any]]) -
adapter(SimpleInfo)
-
-
返回
- None
staticmethod remove_adapter(ctx, adapter)
-
参数
-
ctx(list[dict[str, Any]]) -
adapter(SimpleInfo)
-
-
返回
- bool
staticmethod add_plugin(ctx, plugin)
-
参数
-
ctx(list[str]) -
plugin(SimpleInfo | str)
-
-
返回
- None
staticmethod remove_plugin(ctx, plugin)
-
参数
-
ctx(list[str]) -
plugin(SimpleInfo | str)
-
-
返回
- bool