NoneBot2 course schedule plugin with queries, imports, reminders, and holiday checks
Project description
nonebot-plugin-class-schedule
适用于 NoneBot2 + OneBot V11 的课程表插件,支持课程查询、课表导入、作息表导入、课前提醒、节假日识别和文字/图片输出。
功能
- 实时查询:
/现在什么课、/等会什么课 - 每日查询:
/今天什么课、/明天什么课、/周一到/周日 - 汇总查询:
/本周课表、/第几周、/我的课表 - 数据导入:
/导入课表、/导入作息表、/确认导入、/确认导入作息 - 提醒功能:
/课前提醒、/假期订阅 - 其他:
/查课 <课目>、/放假没、/课表风格
安装
推荐使用 NB-CLI 安装:
nb plugin install nonebot-plugin-class-schedule
也可以使用 pip 安装基础版:
pip install nonebot-plugin-class-schedule
如果需要图片输出:
pip install "nonebot-plugin-class-schedule[image]"
如果需要课前提醒和假期订阅:
pip install "nonebot-plugin-class-schedule[reminder]"
全部功能:
pip install "nonebot-plugin-class-schedule[all]"
加载插件
如果使用 NB-CLI 安装,通常会自动写入项目配置。
手动安装时,推荐在 pyproject.toml 中配置:
[tool.nonebot]
plugins = ["nonebot_plugin_class_schedule"]
也可以在自定义入口中手动加载:
nonebot.load_plugin("nonebot_plugin_class_schedule")
数据存储
插件默认使用 nonebot-plugin-localstore 保存用户数据,不会把课程表写入插件安装目录。
你也可以在 .env 中指定数据目录:
CLASS_SCHEDULE_DATA_DIR=/path/to/class_schedule_data
数据文件包括:
schedules/{qq_user_id}.json:用户课程表preferences.json:输出风格、提醒设置、作息表等用户偏好
请不要把这些运行数据提交到 GitHub 或上传到 PyPI。
配置项
| 配置名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
CLASS_SCHEDULE_DATA_DIR |
`str | Path | None` |
常用命令
| 命令 | 功能 |
|---|---|
/课程表帮助 |
查看帮助 |
/现在什么课 |
查询当前课程状态 |
/等会什么课 |
查询下一节课和倒计时 |
/今天什么课 或 /课表 |
查询今日课表 |
/明天什么课 |
查询明日课表 |
/周一 到 /周日 |
查询指定星期课表 |
/本周课表 |
查询本周概览 |
/第几周 |
查询当前教学周 |
/我的课表 |
查看完整课表 |
/查课 <课目> |
搜索今天的某门课 |
/导入课表 |
进入课表导入流程 |
/导入作息表 |
进入作息表导入流程 |
/课表风格 文字 |
切换为文字输出 |
/课表风格 图片 |
切换为图片输出,需要 image 额外依赖 |
/课前提醒 开/关 |
开关课前提醒,需要 reminder 额外依赖 |
/假期订阅 开/关 |
开关假期提醒,需要 reminder 额外依赖 |
/放假没 |
查询今天是否节假日或补班 |
导入课表
发送 /导入课表 后,按提示发送课程内容:
周一:
早读 英语(李老师)
第1节 数学 @A201
第2节 物理(王老师)
第3节 化学
晚自习 语文
周二:
第1节 英语
第2节 数学
支持:
- 星期:
周一、星期一、周一: - 节次:
早读、第1节、第一节、1节、晚自习 - 老师:
(老师名)或(老师名) - 地点:
@地点或#地点
解析完成后发送 /确认导入 保存,或 /取消导入 放弃。
导入作息表
发送 /导入作息表 后,按提示发送作息时间:
早读 07:00-07:30
第1节 08:00-08:45
第2节 08:55-09:40
午休 12:00-14:00
第5节 14:00-14:45
晚自习 18:20-21:00
解析完成后发送 /确认导入作息 保存,或 /取消导入作息 放弃。
提醒
课前提醒:
/课前提醒 开
/课前提醒 关
/课前提醒 提前5分钟
假期订阅:
/假期订阅 开
/假期订阅 关
提醒功能依赖 nonebot-plugin-apscheduler。如果没有安装,查询和导入功能仍可正常使用。
隐私与发布注意事项
本仓库不包含任何真实课表数据、QQ 号、Token、Cookie、数据库或 .env 文件。
发布前建议检查:
python -m build
tar -tf dist/*.tar.gz
python -m twine check dist/*
确认构建产物里没有 data/、*.json、.env、数据库文件或真实用户信息后再上传。
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_class_schedule-1.0.4.tar.gz.
File metadata
- Download URL: nonebot_plugin_class_schedule-1.0.4.tar.gz
- Upload date:
- Size: 30.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eb5f455c0b7220866eca99d780a2e05fdea368e3514d3549aeb42623f0b4529
|
|
| MD5 |
96a433dd474198eb7b6ed9edbd1e27a9
|
|
| BLAKE2b-256 |
ea8fe953ad60b8e7504d3f34ff58b69aeda036fa449f1a1de14b345a41aff2f5
|
File details
Details for the file nonebot_plugin_class_schedule-1.0.4-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_class_schedule-1.0.4-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d2fcb4a8b2e64345c59a58750fbd0c21018911e6c34ceb3d69715a4b270f3f2
|
|
| MD5 |
c4edf7368dbfb9e67f6b85433e2a6d13
|
|
| BLAKE2b-256 |
cf3a5321e3efa878757b05dc7c75030cae93aa9a841e34c250497879107eeddc
|