Skip to main content

nonebot-plugin-exhibitionism

✨ 让我看看!!赛博露阴癖,将你的代码展示到群聊 ✨

license pypi python

📖 介绍

这是一个让你的代码被群友看光光的 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 /帮助

插件会:

  1. 自动匹配到对应的处理器
  2. 获取处理器的源码
  3. 使用 Pygments 进行语法高亮
  4. 生成精美的代码图片并发送

⚙️ 配置

本插件无需额外配置,安装即可使用。

配置项

  • 代码风格:使用 one-dark 主题
  • 字体大小:22px
  • 包含行号显示
  • 自动背景色处理

🔧 工作原理

  1. 命令解析:支持通过 Alconna 和传统 Matcher 两种方式匹配指令
  2. 处理器查找:模仿 Nonebot 事件处理流程,找到匹配的目标
  3. 源码提取:使用 inspect 模块获取处理器函数的源码
  4. 代码渲染:使用 Pygments 进行语法高亮,生成高质量代码图片
  5. 图片发送:将生成的图片通过 UniMessage 发送到群聊

🤝 贡献

欢迎提交 issue 和 pull request!

📄 许可证

本项目采用 AGPL-3 许可证。

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)

Source distribution for nonebot_plugin_exhibitionism 0.1.1
File Size Uploaded
nonebot_plugin_exhibitionism-0.1.1.tar.gz 15.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot_plugin_exhibitionism 0.1.1
File Interpreter ABI Platform
nonebot_plugin_exhibitionism-0.1.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

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