运行nonebot.init(),读取配置文件,初始化Nonebot和Driver对象 注册协议适配器Adapter 加载插件 准备工作完成后,Nonebot会利用异步进行启动,并且会运行on_startup钩子函数 随后,协议端与Nonebot进行连接,Driver将数据提交给Adapter,然后,实例化Bot,Nonebot会利用Bot开始工作: 事件处理:Bot会将协议端上报的数据转换为Event事件...
NoneBot2 OneBot 适配器 / OneBot adapter for nonebot2. Contribute to nonebot/adapter-onebot development by creating an account on GitHub.
NoneBot-Adapter-Satori ✨ NoneBot2 Satori Protocol适配器 / Satori Protocol Adapter for NoneBot2 ✨ 协议介绍 Satori Protocol 协议端 目前提供了 satori 协议实现的有: Chronocat nekobox Koishi (搭配 @koishijs/plugin-server, 其余内容请自行阅读 koishi 文档) 配置 修改NoneBot 配置文件 .env 或者.env....
pip install nonebot-adapter-onebot # 安装onebot调度器 # 安装一些需要用到的库 pip install pydantic loguru pygtrie pip install nonebot2 pip install nonebot_plugin_gocqhttp # 安装需要使用的插件,这里使用插件启动go-cqhttp,无序安装额外的软件这...
from nonebot.adapters.onebot import Adapter as ONEBOT_ADAPTER 确保你的导入语句与上述示例相匹配。 检查Python环境变量: 如果导入路径正确,但问题仍未解决,可能是因为Python环境变量设置不正确。你可以尝试在干净的虚拟环境中重新安装这些包,以确保没有版本冲突或环境污染。 创建并激活虚拟环境的命令如下(以venv为例...
pip install pydantic loguru pygtrie httpx python-dotenv uvicorn fastapi requests selenium aiocqhttp ffmpeg aiohttp nb-cli nonebot2 nonebot-plugin-apscheduler nonebot-adapter-cqhttp -i https://pypi.tuna.tsinghua.edu.cn/simple 由于很多所以下载过程很慢...---(静静期待!或者看看川川的教学) 下载成功...
下一步,which adapter(s) would you like to use ,这时候按上下键,把光标移到cqhttp那行,按下空格(实测可以鼠标点击),再Enter 这样我们就完成了一个机器人项目的创建 打开Bot.py,可以看到这样 #!/usr/bin/env python3# -*- coding: utf-8 -*-importnonebotfromnonebot.adapters.cqhttpimportBotasCQHTTPBot...
("error.log",# rotation="00:00",# diagnose=False,# level="ERROR",# format=default_format)# You can pass some keyword args config to init functionnonebot.init()app=nonebot.get_asgi()driver=nonebot.get_driver()nonebot.load_builtin_plugins()driver.register_adapter("cqhttp",CQHTTPBot)nonebot...
driver.register_adapter("cqhttp",CQHTTPBot) nonebot.load_builtin_plugins()# 加载 nonebot 内置插件 nonebot.load_from_toml("pyproject.toml") nonebot.load_plugins("src/plugins")# 加载插件目录,该目录下为各插件,以下划线开头的插件将不会被加载 ...
pip install nonebot-adapter-cqhttp 1. 配置CQHTTP 协议端 下载go-cqhttp 对应平台的 release 文件:https://github.com/Mrs4s/go-cqhttp/releases 选择 go-cqhttp_windows_amd64.zip下载进行解压 运行exe 文件 # 第一次运行 ...