Skip to main content

nonebot-plugin-daily-attendance

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

功能

  • 每日运势生成 —— 基于用户ID和日期的伪随机运势(Beta 分布),确保每日不同
  • 等级系统 —— 经验值累积,50 个等级等你挑战
  • 随机一言 —— 来自一言 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 所有人 群聊/私聊 查看帮助

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

示例

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

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

数据存储

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

许可证

MIT(与原项目一致)

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

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_daily_attendance-0.2.1.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file nonebot_plugin_daily_attendance-0.2.1.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_daily_attendance-0.2.1.tar.gz
Algorithm Hash digest
SHA256 84aa430e61b5865a426fc29d1fd8b2c49a11ae71ee5d014fd19b61a8f0d15216
MD5 9f3a14835ccb563ef2efd88992ff9fed
BLAKE2b-256 df90d722d09cc104ebf79379db37f68f3688c3f0d108025b992c952f6f8e158b

See more details on using hashes here.

File details

Details for the file nonebot_plugin_daily_attendance-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_daily_attendance-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc6426f911243a0bd20f9e47c572d786ae2f977875477a5efc751c5b2b94c007
MD5 416da63c05985f222586f7ee401d77be
BLAKE2b-256 c7704e046daa88879875622add644b3eae1716bd406fb7c77bde58f92b0cba3d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

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