Skip to main content

nonebot-plugin-daily-attendance

移植自 Daily-Attendance-plugin(TRSS-Yunzai 插件)的 NoneBot2 每日运势签到插件。

功能

  • 每日运势生成 —— 基于用户ID和日期的伪随机运势(Beta 分布),确保每日不同
  • 等级系统 —— 经验值累积,80 个等级等你挑战
  • 随机一言 —— 来自一言 API 的精选语录,支持本地备用库
  • 搞怪黄历 —— 每日宜忌事项,趣味十足
  • 时间问候 —— 根据当前时间智能问候
  • 特殊日期 —— 支持特定日期自定义运势、一言、黄历、经验加成
  • 美观渲染 —— 基于 Skia 原生绘制的精美图片卡片(无需 Chromium,轻量部署)
  • 自动清理 —— 快照数据每日 00:00 自动清理,60 天未签到用户数据自动归档

安装

使用 nb-cli 安装

nb plugin install nonebot-plugin-daily-attendance

使用 pip 安装

pip install nonebot-plugin-daily-attendance

使用 poetry 安装

poetry add nonebot-plugin-daily-attendance

图片渲染使用 Skia 原生绘制(skia-python + Pillow),无需安装 Chromium / Playwright,适合低配云服务器。绘图会自动搜索系统中文字体(Windows 微软雅黑、Linux Noto Sans CJK、macOS 苹方),也可通过配置指定。

配置

在 NoneBot 项目的 .env 文件中添加(可选,均有默认值):

# 用户数据存储目录(默认为插件包内 data/ 目录)
DAILY_ATTENDANCE_DATA_DIR=/path/to/data

# 绘图字体文件路径,多个用分号分隔(留空自动搜索系统字体)
DAILY_ATTENDANCE_FONT=C:/Windows/Fonts/msyh.ttc

其他业务数据配置位于插件包 config_data/ 目录下的 JSON 文件:

  • levelData.json —— 等级数据配置
  • fortuneData.json —— 运势描述配置
  • timeGreetings.json —— 时间问候语配置
  • Things.json —— 黄历事件配置(包含宜忌事项)
  • apis.json —— API 地址配置(一言 API、背景图 API)
  • specialDates.json —— 特殊日期配置(可选,用于设置特定日期的运势、一言等)

备用一言库 hitokotoBackup.json 会在数据目录中自动生成,无需手动配置。

使用方法

指令 权限 范围 说明
#今日运势 / #jrys / #孑然一身 所有人 群聊/私聊 获取今日运势并签到
#运势统计 / #ystj 所有人 群聊/私聊 查看个人统计信息
#运势数据 / #yssj 所有人 仅群聊 查询当前群聊今日签到情况
#运势总数据 / #yszsj 所有人 群聊/私聊 查询总的今日签到情况(仅当日数据)
#运势排行榜 / #ysphb 所有人 群聊/私聊 查看全局运势排行榜
#一言统计 / #yytj 所有人 群聊/私聊 查看备用一言库统计信息
#运势帮助 / #ysbz 所有人 群聊/私聊 查看帮助

所有指令的 # 前缀均可省略。

馒头好感度联动(可选)

同时加载 nonebot-plugin-mantou-affection 后,群聊运势卡会读取发起者在当前群的馒头好感度。 运势短句会随关系阶段逐步变得更熟悉、亲近和暧昧;运势数值、签到经验及每日快照规则不变。 文案由好感插件文案库的 daily_attendance.fortune 场景提供,同一用户当天稳定;该联动是软依赖, 未加载好感度插件时会保持原有文案。

示例

用户:#今日运势 机器人:[运势图片](运势值、等级进度、今日宜忌、一言)

用户:#运势统计 机器人:📊 个人统计信息 ……

数据存储

  • 用户签到数据:{数据目录}/user_signs/{user_id}.json
  • 每日快照数据:{数据目录}/snapshot/{user_id}_{date}.json(每日 00:00 自动清空)
  • 过期用户数据:{数据目录}/expired/(60 天未签到自动归档,再次签到时自动恢复)
  • 备用一言库:{数据目录}/hitokotoBackup.json(自动生成)

许可证

MIT(与原项目一致)

免责声明:本插件仅供娱乐使用,运势内容为随机生成,请勿迷信。

Metadata

Release files for nonebot-plugin-daily-attendance 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-daily-attendance 0.2.3
File Size Uploaded Provenance Actions
nonebot_plugin_daily_attendance-0.2.3.tar.gz 50.2 kB Without provenance Details for nonebot_plugin_daily_attendance-0.2.3.tar.gz

Built distribution (wheel)

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

Total release size: 103.0 kB

Release files / nonebot_plugin_daily_attendance-0.2.3.tar.gz

Download URL nonebot_plugin_daily_attendance-0.2.3.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
01201726fdfffa0981992aa5fe12ac034384e9a3a6977ba9fce17cb7b14537cd
BLAKE2b-256 checksum
How to use checksums
239b1853dfa45eacd2cb532c9124e416b9844844d077a8d98052e6495f677767
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

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

Download URL nonebot_plugin_daily_attendance-0.2.3-py3-none-any.whl
Size 52.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a50a9730590c082382407aeb97b928b5247f0dadd01d8f440d5c8903450d66c5
BLAKE2b-256 checksum
How to use checksums
6545290732174ea0d32a5fd50742cf68dda92bd3ca50aafa7e934f0dbd77bb31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for nonebot-plugin-daily-attendance 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