Skip to main content

nonebot_plugin_hoshino_sign 的重置版

Project description

NoneBotPluginLogo

nonebot-plugin-pcr-sign

✨ pcr签到 集印章/邮戳 ✨

license pypi python pre-commit.ci status NoneBot Registry

📖 介绍

一个从 一个从 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 或者结构 CustomSourceLoliAPILolicon 均为网络请求获取随机背景图,random为从默认签到背景目录中随机, CustomSource 用于自定义背景图。 默认为 default

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

以下是 CustomSource 用法

在配置文件中设置 xxx_background_sourceCustomSource结构的字典

CustomSource配置示例
  • 网络链接

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

[!TIP]

  • uri 也可以为本地图片路径,如 imgs/image.jpg/path/to/image.jpg
  • 如果本地图片路径是相对路径,会使用 nonebot-plugin-localstore 指定的 data 目录作为根目录
  • 如果本地图片路径是目录,会随机选择目录下的一张图片作为背景图
sign_background_source = '{"uri": "/imgs/image.jpg"}'

🎉 使用

[!NOTE] 记得使用命令前缀

🪧 指令表

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

🫣 暗语表

[!NOTE] 🧭 暗语使用指北

暗语消息来自 nonebot-plugin-argot 插件

对暗语对象回复对应的暗语指令即可获取暗语消息

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

[!TIP] 注意暗语消息有过期时间,默认 5min 后失效,可通过配置修改

📸 效果图

🐾 签到图

示例图1

🎞️ 收集册

示例图2

💖 鸣谢

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_pcr_sign-0.1.4.tar.gz (54.7 MB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_pcr_sign-0.1.4-py3-none-any.whl (54.7 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_pcr_sign-0.1.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_pcr_sign-0.1.4.tar.gz
  • Upload date:
  • Size: 54.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for nonebot_plugin_pcr_sign-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8a4a0f7f36f8ce7e47640a01215c6740abcf5f045764c5c716fd44d3e253a0f8
MD5 1d17eb2328459c8324125393bd907ee5
BLAKE2b-256 a5758ba035988369cfb69ebdb2fbc0e97511cb4b5eabd8134f315453b0a8695d

See more details on using hashes here.

File details

Details for the file nonebot_plugin_pcr_sign-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_pcr_sign-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 610e668d31797873466a91c643246677a7638031ca601f1e06bde97ed28b893e
MD5 78aa9dc8d8ec0afc9c92453288c6f75f
BLAKE2b-256 91aec18034034c4346c9631c71e967942652077dad5a3756bf240d0ea4a8b12e

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