
# 安装
# NoneBot
注意
请确保你的 Python 版本 >= 3.7。
注意
请在安装 nonebot2 之前卸载 nonebot 1.x
pip uninstall nonebot
1
# 通过脚手架安装(推荐安装方式)
(可选)使用你喜欢的 Python 环境管理工具创建新的虚拟环境。
使用
pip
(或其他) 安装 NoneBot 脚手架。pip install nb-cli
1点个 star 吧
nonebot2:
(opens new window)
nb-cli:
(opens new window)
# 不使用脚手架(纯净安装)
# poetry
poetry add nonebot2
# pip
pip install nonebot2
1
2
3
4
2
3
4
如果你需要使用最新的(可能尚未发布的)特性,可以直接从 GitHub 仓库安装:
# master
poetry add git+https://github.com/nonebot/nonebot2.git#master
# dev
poetry add git+https://github.com/nonebot/nonebot2.git#dev
1
2
3
4
2
3
4
或者克隆 Git 仓库后手动安装:
git clone https://github.com/nonebot/nonebot2.git
cd nonebot2
poetry install --no-dev # 推荐
pip install . # 不推荐
1
2
3
4
2
3
4
# 安装插件
插件可以通过 nb-cli
进行安装,也可以自行安装并加载插件。
# 列出所有的插件
nb plugin list
# 搜索插件
nb plugin search xxx
# 安装插件
nb plugin install xxx
1
2
3
4
5
6
2
3
4
5
6
如果急于上线 Bot 或想要使用现成的插件,以下插件可作为参考:
# 官方插件
自用插件 确信
- NoneBot-Plugin-Docs (opens new window) 离线文档插件
- NoneBot-Plugin-Test (opens new window) 本地机器人测试前端插件
- NoneBot-Plugin-APScheduler (opens new window) 定时任务插件
- NoneBot-Plugin-Sentry (opens new window) Sentry 在线日志分析插件
- NoneBot-Plugin-Status (opens new window) 服务器状态查看插件
# 其他插件
还有更多的插件在 这里 等着你发现~