Skip to main content

让群友视奸你的电脑 - NoneBot2 插件

Project description

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 通知群号(群通知)
PEEK_NOTIFY_USER None 通知用户 QQ 号(私聊通知)
PEEK_TIMEOUT 60.0 请求超时时间(秒)
PEEK_RETRIES 2 失败重试次数

配置示例

# 单主机配置
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

🎉 使用

[!TIP] 以下指令需要添加配置的 COMMAND_START

指令表

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

备用资源

当请求失败时,插件会尝试返回备用图片/音频。仓库已自带默认资源,位于:

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

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

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

📦 依赖项目

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

📄 许可证

本项目采用 MIT 许可证。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_peek-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_peek-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_peek-0.1.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_peek-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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}

File hashes

Hashes for nonebot_plugin_peek-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01df98ac5f053f6b946de2009de96eaea526788513ba19551fb20afc1b132eba
MD5 b174ccb4b8da61621e3d05c5523ffdef
BLAKE2b-256 abfd93d03d2c93f289f7a26f95486b586817b5fd16725d41f2236a5ecc743767

See more details on using hashes here.

File details

Details for the file nonebot_plugin_peek-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nonebot_plugin_peek-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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}

File hashes

Hashes for nonebot_plugin_peek-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c7529509b3a80ac24caab57f7904d125a57573bd57b0c45ae60fd42b0e9291f
MD5 01236911678aee492bc06fb2a2f3a7cb
BLAKE2b-256 8bf4d5ea9db1fbe4263c1a1ae3953b23ec6cc6424b3ad1b9306527b4823864b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page