Skip to main content

nonebot

NoneBot Plugin Test

✨ 在浏览器中测试你的 NoneBot 机器人 ✨

license pypi python

截屏展示


模块加载状态一览无余

人性化的交互式测试

消息匹配器图形化展示

可高度自定义的测试配置

使用方法

加载插件

nonebot.load_plugin("nonebot_plugin_test")

在日志中将会输出测试网站地址,通常为 http://HOST:PORT/test/

准备开发

首先你需要安装 npm 的本地依赖:

npm install

不建议单独为此项目新建虚拟环境,直接在你原有的 nonebot 虚拟环境下使用即可。

进行开发

使用命令启动前端页面的开发服务器,你对前端页面的任何修改都可以预览:

npm run serve

这时候的页面连接不到 nonebot2 的实例,所以只能进行页面的开发。

下面介绍一下如何连接到已有的 nonebot2 项目上。

由于开启了 devServer 中的 writeToDisk 选项, webpack-dev-server 会将每次编译产生的文件写入 ./nonebot_plugin_test/dist 文件夹。

打开你的 bot 源码目录以及虚拟环境,将原来已经安装的 nonebot-test 包移除掉:

pip uninstall nonebot-test

将 bot 的依赖改为本地依赖:

- nonebot-test = { version = "^0.1.0", optional = true }
+ nonebot-test = { path = "relative/path/to/nonebot-test/", develop = true }

然后使用 poetry 重新安装依赖即可:

poetry update
poetry install

现在启动你的 bot,本地nonebot-test 包就可以开始工作了,打开 localhost:2333 (不需要打开前面所述的前端开发服务器:8080)就可以查看实时最新的前端页面了。

python bot.py

Metadata

Release files for nonebot-plugin-test 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-test 0.3.0
File Size Uploaded
nonebot-plugin-test-0.3.0.tar.gz 539.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-test 0.3.0
File Interpreter ABI Platform
nonebot_plugin_test-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / nonebot-plugin-test-0.3.0.tar.gz

Download URL nonebot-plugin-test-0.3.0.tar.gz
Size 539.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6cea9342f4df69a73b9aa27a3eaa22a08c6e54b675e2e6638b4b3fc8568cd6fe
BLAKE2b-256 checksum
How to use checksums
09ecb1c57fb5135f1cb210040aa12f58d50498072b59f696de378908dd2b2181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.5 Linux/5.4.0-80-generic

Release files / nonebot_plugin_test-0.3.0-py3-none-any.whl

Download URL nonebot_plugin_test-0.3.0-py3-none-any.whl
Size 541.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edb880340436323ccd0a13b31d48975136b6bdc71daa178601c4b05b068cc73e
BLAKE2b-256 checksum
How to use checksums
5e70a225878b1f360368842046effc4be9b424b81544b8c213850411c4a709e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.5 Linux/5.4.0-80-generic

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page