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 所有人 群聊/私聊 查看帮助

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

示例

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

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

数据存储

  • 用户签到数据:{数据目录}/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.2.tar.gz (49.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_daily_attendance-0.2.2-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_daily_attendance-0.2.2.tar.gz
Algorithm Hash digest
SHA256 22a57f8275b88a149ef11be62481c36774cbdf520fb6f128aec53872733c2c7b
MD5 077d7aba1bd86b253eaa96a72ea6234a
BLAKE2b-256 4fb7edec2c222bd1cc7eb3e6a668f692614fb791796eea503aa3286a88c8f7c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_daily_attendance-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d5daa31e27f3de82af6c52cde87608ec8f7a96c0ff750677988375b1a2b7b90
MD5 b5e5eef6fdb6b674991107f92c1c7b22
BLAKE2b-256 9abf38337a24bf208c06af0d66d3c35f409328ffc9dd77eb24855cf1585ee1f2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 files

0.2.1

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