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 通知群/频道 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

🎉 使用

[!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

🎨 效果图

example

📄 许可证

本项目采用 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.2.0.tar.gz (9.7 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.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_peek-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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.2.0.tar.gz
Algorithm Hash digest
SHA256 77443bf302e15a2deeac9f218f2421800d94993b0474178a337989f35e0a4c37
MD5 244c94c81ee5b76c58b990ff7c338d55
BLAKE2b-256 1bf651662676270134f22a9ff47ddf6db630ef9e16fc5bf2be365685d7d62e6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_plugin_peek-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2736f2df2d5b445829a77224eb33977a70a93f0b74cf61633aab29760b9d169
MD5 f9a713fc4d118fc6fbf095ae32c4f027
BLAKE2b-256 cd85947bb4dd2ae6256e91d475b467c512394bf51f423a9026d079548e3ee71c

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