Skip to main content
NoneBotPluginLogo

nonebot-plugin-pcr-sign

✨ pcr签到 集印章/邮戳 ✨

license pypi python pre-commit.ci status NoneBot Registry uv ruff CodeFactor

📖 介绍

一个从 一个从 hoshino 抄借鉴的 nonebot2 签到插件nonebot-plugin-hoshino-sign 抄借鉴的 nonebot2 签到插件

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-pcr-sign
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-pcr-sign
pdm
pdm add nonebot-plugin-pcr-sign
poetry
poetry add nonebot-plugin-pcr-sign
conda
conda install nonebot-plugin-pcr-sign

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

plugins = ["nonebot_plugin_pcr_sign"]

⚙️ 配置

配置表

在 nonebot2 项目的.env文件中修改配置项

配置项 必填 默认值 说明
sign_argot_expire_time 否 300 暗语过期时间(单位:秒 类型:int)
stamp_path 否 RES_DIR / "stamps" 印章图片路径
sign_background_source 否 "default" 签到背景图来源
album_background_source 否 "default" 收集册背景图来源

background_source

sign_background_source 为签到背景图来源,可选值为字面量 default / LoliAPI / Lolicon / random 或者结构 CustomSource 。LoliAPI 和 Lolicon 均为网络请求获取随机背景图,random为从默认签到背景目录中随机, CustomSource 用于自定义背景图。 默认为 default。

album_background_source 为收集册背景图来源,可选值为字面量 default / kraft / pcr / prev / random 或者结构 CustomSource 。前四者均为预设背景,random为从默认收集册背景目录中随机,CustomSource 用于自定义背景图。 默认为 default。

以下是 CustomSource 用法

在配置文件中设置 xxx_background_source 为 CustomSource结构的字典

CustomSource配置示例
  • 网络链接

    • uri 可为网络图片 API,只要返回的是图片即可
    • uri 也可以为 base64 编码的图片,如 data:image/png;base64,xxxxxx (一般也没人这么干)
sign_background_source = '{"uri": "https://example.com/image.jpg"}'
  • 本地图片
sign_background_source = '{"uri": "/imgs/image.jpg"}'

🎉 使用

🪧 指令表

指令 权限 参数 说明
sign/签到/盖章/妈 所有 无 签到
album/收集册 所有 无 or @ 查看自己(或别人)的收集册

🫣 暗语表

暗语指令 对象 说明
background 签到图 查看背景图
stamp 签到图 获取印章图
raw 签到图 获取原文字消息

📸 效果图

🐾 签到图

示例图1

🎞️ 收集册

示例图2

🚚 迁移

如果有从nonebot-plugin-hoshino-sign迁移数据到本插件的需求

请使用 pip install nonebot-plugin-pcr-sign[cli] 安装所需依赖

或uv add nonebot-plugin-pcr-sign[cli]什么的,总之加上[cli],别那么死板

nonebot-plugin-hoshino-sign 的默认数据目录为 "./data/nonebot_plugin_hoshino_sign/"

目录结构如下:

  • 数据根目录
    • json
      • goodwill.json
    • db
      • pcr_stamp.db

运行 nb pcr migrate 进行迁移,默认会指向该路径寻找旧数据文件

如果旧数据在其他路径保存,可以使用 nb pcr migrate -d <path> 指定数据文件根路径

例如:nb pcr migrate -d ./data/sign/

💖 鸣谢

📋 TODO

  • 数据迁移脚本(从原hoshino_sign插件迁移数据)
  • 待补充,欢迎pr

Metadata

Release files for nonebot-plugin-pcr-sign 0.3.2

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-pcr-sign 0.3.2
File Size Uploaded Provenance Actions
nonebot_plugin_pcr_sign-0.3.2.tar.gz 50.3 MB Without provenance Details for nonebot_plugin_pcr_sign-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-pcr-sign 0.3.2
File Interpreter ABI Platform Actions
nonebot_plugin_pcr_sign-0.3.2-py3-none-any.whl Python 3 none any Details for nonebot_plugin_pcr_sign-0.3.2-py3-none-any.whl

Total release size: 100.5 MB

Release files / nonebot_plugin_pcr_sign-0.3.2.tar.gz

Download URL nonebot_plugin_pcr_sign-0.3.2.tar.gz
Size 50.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a86b11a6faacba00962d280f4b906b910862dbda0e1e8b511bea80f79552d4b9
BLAKE2b-256 checksum
How to use checksums
e9424f79b8f20f76a6eea2ea1259aced73f97a18b76f9abb4f935b9c1772f7da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / nonebot_plugin_pcr_sign-0.3.2-py3-none-any.whl

Download URL nonebot_plugin_pcr_sign-0.3.2-py3-none-any.whl
Size 50.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8704165784af1c8f06386e58d8a2d7752e48a5f7d15d7a2e5a733a1c01f6178f
BLAKE2b-256 checksum
How to use checksums
ee2e9a09292df8a2827ad33ba14755b17d2dfbec42225c55d2f9934cadbcc7ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for nonebot-plugin-pcr-sign 0.3.2

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