Skip to main content
logo

✨ nonebot-plugin-peek ✨

LICENSE python Adapters

uv ruff

📖 介绍

让群友实践你的电脑屏幕和音频。需要配合 PeekAPI 服务运行。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-peek --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-peek --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-peek --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-peek

安装仓库 main 分支

uv add git+https://github.com/Misty02600/nonebot-plugin-peek@main
pdm
pdm add nonebot-plugin-peek

安装仓库 main 分支

pdm add git+https://github.com/Misty02600/nonebot-plugin-peek@main
poetry
poetry add nonebot-plugin-peek

安装仓库 main 分支

poetry add git+https://github.com/Misty02600/nonebot-plugin-peek@main

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_peek"]
使用 nbr 安装(使用 uv 管理依赖可用)

nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2

nbr plugin install nonebot-plugin-peek

使用 pypi 源安装

nbr plugin install nonebot-plugin-peek -i "https://pypi.org/simple"

使用清华源安装

nbr plugin install nonebot-plugin-peek -i "https://pypi.tuna.tsinghua.edu.cn/simple"

⚙️ 配置

插件使用nonebot_plugin_localstore储存数据和下载缓存。

在 nonebot2 项目的 .env 文件中添加下表中的配置

配置项 必填 默认值 说明
PEEK_HOSTS 否 ["127.0.0.1:1920"] PeekAPI 服务地址列表(JSON 格式)
PEEK_KEY 否 None API 密钥(用于获取原图)
PEEK_DEFAULT_RADIUS 否 5 默认的截图高斯模糊半径
PEEK_NOTIFY_GROUP 否 None 通知群/频道 ID(群通知)
PEEK_NOTIFY_USER 否 None 通知用户 ID(私聊通知)
PEEK_TIMEOUT 否 15.0 请求超时时间(秒)
PEEK_RETRIES 否 1 失败重试次数

配置示例:

# 单主机配置
PEEK_HOSTS=["192.168.1.100:1920"]

# 多主机配置(自动选择最近操作的主机)
PEEK_HOSTS=["pc1.local:1920","pc2.local:1920","192.168.1.100:1920"]

PEEK_KEY=your_secret_key
PEEK_DEFAULT_RADIUS=5
PEEK_NOTIFY_GROUP=123456789
PEEK_NOTIFY_USER=987654321

🎉 使用

指令表

指令 权限 需要@ 范围 说明
peek 所有人 否 私聊/群聊 获取模糊屏幕截图
peek 原图 超级用户 否 私聊/群聊 获取原图(需配置密钥)
peep 所有人 否 私聊/群聊 获取音频录制

备用资源

当请求失败时,插件会尝试返回备用图片/音频。仓库已自带默认资源,可以自行下载使用。

data/nonebot_plugin_peek/
├── 401.jpg        # 权限不足时显示
├── 403.jpg        # 私密模式时显示/播放
├── error.jpg      # 错误时显示/播放
├── 403.wav
└── error.mp3

支持的图片格式:.jpg .png .gif .webp 支持的音频格式:.wav .mp3 .ogg .flac

插件按文件名前缀(401、403、error)匹配,可替换为任意支持的格式。若资源文件不存在,仅发送文字提示。

📦 依赖项目

插件需要配合 PeekAPI 使用。如果电脑没有公网,建议搭配 frp 或者 Tailscale。

🧭 开发文档

🎨 效果图

example

📄 许可证

本项目采用 MIT 许可证。

Metadata

Release files for nonebot-plugin-peek 0.2.3

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-peek 0.2.3
File Size Uploaded Provenance Actions
nonebot_plugin_peek-0.2.3.tar.gz 10.3 kB Without provenance Details for nonebot_plugin_peek-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-peek 0.2.3
File Interpreter ABI Platform Actions
nonebot_plugin_peek-0.2.3-py3-none-any.whl Python 3 none any Details for nonebot_plugin_peek-0.2.3-py3-none-any.whl

Total release size: 21.0 kB

Release files / nonebot_plugin_peek-0.2.3.tar.gz

Download URL nonebot_plugin_peek-0.2.3.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cab302ebf390cf3dafff2a90b440ce271242ae395ef05036caff9d81b6b936eb
BLAKE2b-256 checksum
How to use checksums
96021946f69d54bab2f19bdbcb72f5ea31bed0b418b20feec9c96fc1f65c95a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nonebot_plugin_peek-0.2.3-py3-none-any.whl

Download URL nonebot_plugin_peek-0.2.3-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8acca91a26c499cc4ad89199acf9ab32e3caccac234c612e209c9301860738e2
BLAKE2b-256 checksum
How to use checksums
2bd4941bb5efe7a40aaa5af906e0c966e4b5307444a3f660a64ca5bb8f921339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for nonebot-plugin-peek 0.2.3

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.

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