📖 介绍
这是一个让你的代码被群友看光光的 NoneBot2 插件!🔍
当你想要展示某个指令的源码实现时,只需要使用 /see 命令,插件会自动找到对应的处理器并将其源码以精美的代码图片形式展示出来。非常适合:
- 代码学习和交流
- 调试和问题排查
- 向群友炫耀你的代码(雾)
- 满足赛博露阴癖
💿 安装
使用 nb-cli 安装
在 NoneBot2 项目的根目录下打开命令行,输入以下指令即可安装:
nb plugin install nonebot-plugin-exhibitionism
使用包管理器安装
pip install nonebot-plugin-exhibitionism
使用 uv 安装
uv add nonebot-plugin-exhibitionism
然后在 NoneBot2 项目的 pyproject.toml 文件中的 [tool.nonebot] 部分添加:
plugins = ["nonebot_plugin_exhibitionism"]
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
/see [目标指令] |
所有人 | 否 | 群聊/私聊 | 查看指定指令的源码 |
效果预览
发送指令:
/see /帮助
插件会:
- 自动匹配到对应的处理器
- 获取处理器的源码
- 使用 Pygments 进行语法高亮
- 生成精美的代码图片并发送
⚙️ 配置
本插件无需额外配置,安装即可使用。
配置项
- 代码风格:使用
one-dark主题 - 字体大小:22px
- 包含行号显示
- 自动背景色处理
🔧 工作原理
- 命令解析:支持通过 Alconna 和传统 Matcher 两种方式匹配指令
- 处理器查找:模仿 Nonebot 事件处理流程,找到匹配的目标
- 源码提取:使用
inspect模块获取处理器函数的源码 - 代码渲染:使用 Pygments 进行语法高亮,生成高质量代码图片
- 图片发送:将生成的图片通过 UniMessage 发送到群聊
🤝 贡献
欢迎提交 issue 和 pull request!
📄 许可证
本项目采用 AGPL-3 许可证。
Metadata
Release files for nonebot_plugin_exhibitionism 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_exhibitionism-0.1.1.tar.gz | 15.2 MB | Without provenance | Details for nonebot_plugin_exhibitionism-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_exhibitionism-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_exhibitionism-0.1.1-py3-none-any.whl |
Total release size: 30.4 MB
Release files / nonebot_plugin_exhibitionism-0.1.1.tar.gz
| Download URL | nonebot_plugin_exhibitionism-0.1.1.tar.gz |
|---|---|
| Size | 15.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef65ac7305dc08781a5d1460093755220cd41e04f627d0b1cc6863f76df03595
|
|
BLAKE2b-256 checksum How to use checksums |
5b99d144ef16334c220f00d0f1a562908f6f4eae6ce6df3854ff99be45e0d1dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Release files / nonebot_plugin_exhibitionism-0.1.1-py3-none-any.whl
| Download URL | nonebot_plugin_exhibitionism-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49f1b4bc89ffc98881037a86f94cd4915acec1f030230c0acd54b590edf96e13
|
|
BLAKE2b-256 checksum How to use checksums |
b0a1d3697bb197561fad73cc76a3dc327427234095a1c89fb2681f96135d78c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Security for nonebot_plugin_exhibitionism 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.